Is widget visible?

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

3 posts / 0 new
Last post
Is widget visible?

Submitted by Anonymous on Tue, 07/10/2001 - 10:34. Developers
If I set the resource XmNmappedWhenManaged to False, I
Must use XtMapWidget/XtUnmapWidget to show/hide a
Widget so, how can I know if the widget is visible or hidden?

Thank you.

ICS_support

It`s better to use XtManageChild/XtUnmanageChild to show/hide a widget, because then the manager widget reallocates space for the children. You wind up with empty space if the widget is managed but not mapped. Alternatively, you can use XtSetSensitive to change the widget if you don`t want the user to interact with it.

But if you really want to check the mapped status of the widget, without keeping track of it, you can check the state of the XtWindow() of the widget, if it is non-NUL. See http//www.motifzone.com/resources/man/XGetWindowAttributes.html for details.

Anonymous

I have tested the map_state field of XWindowAttributes and it works correctly.
Thank you very much.