How can I simply show and hide a widget?
( like ShowWindow() in Microsoft Visual).
Is there an attribute ATR_SHOW or something like that?
or should I use PtRealizeWidget() and PtUnrealizeWidget()?
In this case, what happens if I call PtRealizeWidget or PtUnrealizeWidget twice?
How can I now if a widget is visible or not?
Yes, use PtRealizeWidget()/PtUnrealizeWidget() to “show/hide” widget.
AFAIK, calling either function twice should work well …
Pt_REALIZED in resource flags Pt_ARG_FLAGS tell you whether the widget is realized (visible) or not.
fn PtRealizeWidget(), PtUnrealizeWidget() doesn’t work very well in pre-realize setup function ( post-realize setup fn is not good for initialization of widgets ). I prefer moving widget outside of viewable part of window ( works perfectly for me ).
Opps [QNX4+Photon1.14]
You can use the widget’s Pt_ARG_POS resource (defined in PtWidget). You can set the position to large, negative coordinates to “draw” the widget in a place that isn’t visible. To make the widget appear, just set its position to visible coordinates.