MessageBox is a BulletinBoard subclass intended for a dialog consisting of a single user interaction. By default, a MessageBox has the following components:
Typically the message symbol and text are on top and the buttons on the bottom, with the separator between. The application can add additional children to a MessageBox. Additional children are laid out in the following manner:
Several convenience routines create MessageBox widgets with DialogShell
parents for particular kinds of interactions. For most of these routines, the
principal difference in the type of MessageBox they create is that each uses a
distinct default symbol pixmap. When it creates the symbol pixmap, MessageBox
uses XmGetPixmapByDepth to find a pixmap with a name that corresponds to the
type of interaction. Each dialog type is also associated with a value of the
XmNdialogType resource. The following table shows the correspondence between
creation routine, XmNdialogType, and symbol pixmap name:
Table 5. MessageBox Routines, Dialog Types, and Pixmaps
Convenience Routine | XmNdialogType | Pixmap Name |
XmCreateErrorDialog | XmDIALOG_ERROR | xm_error |
XmCreateInformationDialog | XmDIALOG_INFORMATION | xm_information |
XmCreateMessageDialog | XmDIALOG_MESSAGE | |
XmCreateQuestionDialog | XmDIALOG_QUESTION | xm_question |
XmCreateTemplateDialog | XmDIALOG_TEMPLATE | |
XmCreateWarningDialog | XmDIALOG_WARNING | xm_warning |
XmCreateWorkingDialog | XmDIALOG_WORKING | xm_working |
A MesssageDialog and a TemplateDialog have no default symbol pixmap. A TemplateDialog is a special MessageBox variant that is intended for application customization and that, by default, has no children except the separator.
Like SelectionBox, MessageBox has XmNokCallback, XmNcancelCallback, and XmNhelpCallback lists to inform the application when the user activates a button. MessageBox has resources for supplying label strings and the symbol pixmap for its children. The widget IDs of the children of a MessageBox are not available as resources. The application can retrieve the widget IDs of the automatically created children by using XtNameToWidget or by calling XmMessageBoxGetChild.