Set the XmNdialogType resource for the dialog.•
Install a callback routine for the XmNdestroyCallback resource of the MessageBox, so that it
automatically destroys its DialogShell parent.
•
The XmNdialogType resource can be set to one of the following values:
XmDIALOG_ERROR
XmDIALOG_INFORMATION
XmDIALOG_MESSAGE
XmDIALOG_QUESTION
XmDIALOG_TEMPLATE
XmDIALOG_WARNING
XmDIALOG_WORKING
The type of the dialog does not affect the kind of widget that is created. The only thing the type affects is the graphical
symbol that is displayed in the control area of the dialog. The convenience routines set the resource based on the
routine that is called (e.g. XmCreateErrorDialog() sets the resource to XmDIALOG_ERROR). The widget
automatically sets the graphical symbol based on the dialog type. You can change the type of a dialog after it is
created using XtVaSetValues(); modifying the type also changes the dialog symbol that is displayed.
The Motif dialog convenience routines create DialogShells internally to support the single−object dialog abstraction.
With these routines, the toolkit is responsible for the DialogShell, so the dialog widget uses its
XmNdestroyCallback to destroy its parent upon its own destruction. If the dialog is unmapped or unmanaged, so
is its DialogShell parent. The convenience routines do not add any resources or call any functions to support the
special relationship between the dialog widget and the DialogShell, since most of the code that handles the interaction
is written into ...