Trying to Unrealized a child widget during construction

I have a compound widget which allows multiple PtPane has children, but only
one of those PtPane should be visible at any given time. During the
construction of the widget, any PtPane which are not to be visible are
unreliazed via PtUnrealizeWidget(); this is done by attaching a callback via
Pt_SET_CHILD_REALIZED_F. Problem is that the compount widget does not
properly damage itself, resulting in these “unrealized” panes in becoming
visible. If the widget is damaged (via bringing a dialog/window in front of
this widget), it is redrawn properly. Is there a way to force this compound
widget to redraw itself just after its realization?

Anybody have any suggestions for this issue?

“RIchard Doucet” <doucetr@DONTaeclSPAM.caME> wrote in message
news:dssldr$f9t$1@inn.qnx.com

I have a compound widget which allows multiple PtPane has children, but
only one of those PtPane should be visible at any given time. During the
construction of the widget, any PtPane which are not to be visible are
unreliazed via PtUnrealizeWidget(); this is done by attaching a callback
via Pt_SET_CHILD_REALIZED_F. Problem is that the compount widget does not
properly damage itself, resulting in these “unrealized” panes in becoming
visible. If the widget is damaged (via bringing a dialog/window in front
of this widget), it is redrawn properly. Is there a way to force this
compound widget to redraw itself just after its realization?

The safest way is to use the Pt_DELAY_REALIZE flag. Realizing a widget
hierarchy is a complicated and fragile process, and as you have
discovered, interfering with it by calling PtUnrealizeWidget() while
some of your widgets might be half-realized can sometimes mess things
up. (BTW The same goes for inserting new widget into the hierarchy
being realized.)

The Pt_DELAY_REALIZE flag allows you to completely separate the code
that decides which children need to be visible from the code that runs
when your widgets are being realized on unrealized. Whenever your
widget changes its mind about which child should be visible, just set
the flag of one pane and call PtUnrealizeWidget(), and unset the flag of
the other pane and call PtRealizeWidget(). You don’t even need to pay
attention to whether your widget is realized or not – trying to
unrealize or realize children of a (completely) unrealized parent is
safe and does nothing. This method is tested many times every day: all
our list widgets use it to control their scrollbars.

RIchard Doucet wrote:

Anybody have any suggestions for this issue?

“RIchard Doucet” <> doucetr@DONTaeclSPAM.caME> > wrote in message
news:dssldr$f9t$> 1@inn.qnx.com> …

I have a compound widget which allows multiple PtPane has children, but
only one of those PtPane should be visible at any given time. During the
construction of the widget, any PtPane which are not to be visible are
unreliazed via PtUnrealizeWidget(); this is done by attaching a callback
via Pt_SET_CHILD_REALIZED_F. Problem is that the compount widget does not
properly damage itself, resulting in these “unrealized” panes in becoming
visible. If the widget is damaged (via bringing a dialog/window in front
of this widget), it is redrawn properly. Is there a way to force this
compound widget to redraw itself just after its realization?

Just a thought here. Can’t you achieve this by leaving all the panes
realized and bringing whichever one should be visible to the top?

The only prerequisite here is that all of the panes are the same size and in
the same location.


“RIchard Doucet” <doucetr@DONTaeclSPAM.caME> wrote in message
news:dssldr$f9t$1@inn.qnx.com

I have a compound widget which allows multiple PtPane has children, but
only one of those PtPane should be visible at any given time. During the
construction of the widget, any PtPane which are not to be visible are
unreliazed via PtUnrealizeWidget(); this is done by attaching a callback
via Pt_SET_CHILD_REALIZED_F. Problem is that the compount widget does not
properly damage itself, resulting in these “unrealized” panes in becoming
visible. If the widget is damaged (via bringing a dialog/window in front
of this widget), it is redrawn properly. Is there a way to force this
compound widget to redraw itself just after its realization?