Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Clipping without using PtRaw
Ref. No. QNX.000009780
Category(ies) Development
Issue We are trying to create a tickerbox effect where a long text label scrolls back and forth, but is clipped to a smaller rectangle. We tried using a PtClipAdd call just before widget is redrawn, but we didn't succeed.

Is there a way to clip without just using a PtRaw?


Solution The fastest way to do this would be to set the label's text to the full string to be scrolled (with Pt_RESIZE_XY_ALWAYS set for the resize flags) and drop it onto container of some sort (PtPane or PtContainer).
In case you want to turn on Pt_RESIZE_Y_ALWAYS for the container, turn off all x-resize policies.
Using a timer you can just decrement the x value of the PtLabel's Pt_ARG_POS(starting at x = 0) and you will get the scrolling effect you are looking for.