/* if immediate parent is not a DialogShell, mimic the same * behavior as if it were (i.e., pop down the parent.) */ if
(!XmIsDialogShell (XtParent (dialog))) XtPopdown (GetTopShell (dialog)); } The Motif toolkit defines similar
macros for all of its widget classes. For example, <Xm/MessageB.h> defines the macro XmIsMessageBox():
#define XmIsMessageBox(w) XtIsSubclass (w, xmMessageBoxWidgetClass)
This macro determines whether or not a particular widget is subclassed from the MessageBox widget class. Since all
of the MessageDialogs are really instances of the MessageBox class, the macro covers all of the different types of
MessageDialogs. If the widget is a MessageBox, the macro returns True whether or not the widget is an immediate
child of a DialogShell. Note that this macro does not return True if the widget is a DialogShell.
6.6.3 Internal Widgets
All of the Motif dialog widgets are composed of primitive subwidgets such as Labels, PushButtons, and TextField
widgets. For most tasks, it is possible to treat a dialog as a single entity. However, there are some situations when it is
useful to be able to get a handle to the widgets internal to the dialog. For example, one way to set the default button
for a dialog is to use the XmNdefaultButton resource. The value that you specify for this resource must be a
widget ID, so this is one of those times when it is necessary to get a handle to the actual subwidgets contained within a
dialog.
The Motif toolkit provides routines that allow you to access ...