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 Redrawing a PtLabel
Ref. No. QNX.000005662
Category(ies) Development
Issue We have a serious problem in our application, which was developed using Photon1.13 and QNX 4.25.

We use windows and dialogs with a lot of labels of type IMAGE. We make some Bitmaps children of these labels and need to Realize/Unrealize all these bitmaps through the execution. We found a problem when these labels, which are parents of some bitmaps, have the "Transparent" as the Fill color. the children of these labels can't be unrealized. The Bitmap is still there after calling PtUnrealizeWidget.

If we put any window on top of these bitmaps, and then we take it away, the bitmap will disappear. (If we hide a little of the bitmap, only the covered region disappears).

We tried to call PtSyncWidget, PtDamageWidget, PtFlush, and tried to destroy the bitmap widget, and create it again, instead of Realize/Unrealize. It does not work. We confirmed that if the label does not have the Transparent background (Gray for example) we don't have the problem. All of the child elements Realize/Unrealize well. It
seems to me that Photon is not really Unrealizing the Widget, but hiding it behind its parent.
We need these labels to be transparent, in order to see the background of the Window. Also, we need the bitmaps to be child of these labels because the size and area of the image depend on the labels, and are calculated at the run time.

Is there any other way of showing/hiding  a widget, which will work in our case?

Solution You can not pass the label as a parent to the newly created widget. You should pass a container type widget (like the base window) as the parent.

The library does not handle this and the result is unpredictable.