XmMessageBox(3) | Library Functions Manual | XmMessageBox(3) |
XmMessageBox — The MessageBox widget class "XmMessageBox" "widget class" "MessageBox"
#include <Xm/MessageB.h>
MessageBox is a dialog class used for creating simple message dialogs. Convenience dialogs based on MessageBox are provided for several common interaction tasks, which include giving information, asking questions, and reporting errors.
A MessageBox dialog is typically transient in nature, displayed for the duration of a single interaction. MessageBox is a subclass of BulletinBoard and depends on it for much of its general dialog behavior.
The default value for XmNinitialFocus is the value of XmNdefaultButton.
A typical MessageBox contains a message symbol, a message, and up to three standard default PushButtons: OK, Cancel, and Help. It is laid out with the symbol and message on top and the PushButtons on the bottom. The Help button is positioned to the side of the other push buttons. You can localize the default symbols and button labels for MessageBox convenience dialogs.
The user can specify resources in a resource file for the gadgets created automatically that contain the MessageBox symbol pixmap and separator. The gadget names are Symbol and Separator.
A MessageBox can also be customized by creating and managing new children that are added to the MessageBox children created automatically by the convenience dialogs. In the case of TemplateDialog, only the separator child is created by default. If the callback, string, or pixmap symbol resources are specified, the appropriate child will be created.
Additional children are laid out in the following manner:
At initialization, MessageBox looks for the following bitmap files:
See XmGetPixmap(3) for a list of the paths that are searched for these files.
MessageBox uses the XmQTactivatable and XmQTmenuSystem traits.
MessageBox automatically creates the descendants shown in the following table. An application can use XtNameToWidget to gain access to the named descendant. In addition, a user or an application can use the named descendant when specifying resource values.
Named Descendant | Class | Identity |
Cancel | XmPushButtonGadget | Cancel button |
Help | XmPushButtonGadget | Help button |
Message | XmLabelGadget | displayed message |
OK | XmPushButtonGadget | OK button |
Separator | XmSeparatorGadget | dividing line between message and buttons |
Symbol | XmLabelGadget | icon symbolizing message type |
MessageBox inherits behavior, resources, and traits from Core, Composite, Constraint, XmManager, and XmBulletinBoard.
The class pointer is xmMessageBoxWidgetClass.
The class name is XmMessageBox.
The following table defines a set of widget resources used by the programmer to specify data. The programmer can also set the resource values for the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file, remove the XmN or XmC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). The codes in the access column indicate if the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A).
XmMessageBox Resource Set | ||||
Name | Class | Type | Default | Access |
XmNcancelCallback | XmCCallback | XtCallbackList | NULL | C |
XmNcancelLabelString | XmCCancelLabelString | XmString | dynamic | CSG |
XmNdefaultButtonType | XmCDefaultButtonType | unsigned char | XmDIALOG_OK_BUTTON | CSG |
XmNdialogType | XmCDialogType | unsigned char | XmDIALOG_MESSAGE | CSG |
XmNhelpLabelString | XmCHelpLabelString | XmString | dynamic | CSG |
XmNmessageAlignment | XmCAlignment | unsigned char | XmALIGNMENT_BEGINNING | CSG |
XmNmessageString | XmCMessageString | XmString | "" | CSG |
XmNminimizeButtons | XmCMinimizeButtons | Boolean | False | CSG |
XmNokCallback | XmCCallback | XtCallbackList | NULL | C |
XmNokLabelString | XmCOkLabelString | XmString | dynamic | CSG |
XmNsymbolPixmap | XmCPixmap | Pixmap | dynamic | CSG |
MessageBox inherits behavior and resources from the superclasses described in the following tables. For a complete description of each resource, refer to the reference page for that superclass.
XmBulletinBoard Resource Set | ||||
Name | Class | Type | Default | Access |
XmNallowOverlap | XmCAllowOverlap | Boolean | True | CSG |
XmNautoUnmanage | XmCAutoUnmanage | Boolean | True | CG |
XmNbuttonFontList | XmCButtonFontList | XmFontList | dynamic | CSG |
XmNbuttonRenderTable | XmCButtonRenderTable | XmRenderTable | dynamic | CSG |
XmNcancelButton | XmCWidget | Widget | Cancel button | SG |
XmNdefaultButton | XmCWidget | Widget | dynamic | SG |
XmNdefaultPosition | XmCDefaultPosition | Boolean | True | CSG |
XmNdialogStyle | XmCDialogStyle | unsigned char | dynamic | CSG |
XmNdialogTitle | XmCDialogTitle | XmString | NULL | CSG |
XmNfocusCallback | XmCCallback | XtCallbackList | NULL | C |
XmNlabelFontList | XmCLabelFontList | XmFontList | dynamic | CSG |
XmNlabelRenderTable | XmCLabelRenderTable | XmRenderTable | dynamic | CSG |
XmNmapCallback | XmCCallback | XtCallbackList | NULL | C |
XmNmarginHeight | XmCMarginHeight | Dimension | 10 | CSG |
XmNmarginWidth | XmCMarginWidth | Dimension | 10 | CSG |
XmNnoResize | XmCNoResize | Boolean | False | CSG |
XmNresizePolicy | XmCResizePolicy | unsigned char | XmRESIZE_ANY | CSG |
XmNshadowType | XmCShadowType | unsigned char | XmSHADOW_OUT | CSG |
XmNtextFontList | XmCTextFontList | XmFontList | dynamic | CSG |
XmNtextRenderTable | XmCTextRenderTable | XmRenderTable | dynamic | CSG |
XmNtextTranslations | XmCTranslations | XtTranslations | NULL | C |
XmNunmapCallback | XmCCallback | XtCallbackList | NULL | C |
XmManager Resource Set | ||||
Name | Class | Type | Default | Access |
XmNbottomShadowColor | XmCBottomShadowColor | Pixel | dynamic | CSG |
XmNbottomShadowPixmap | XmCBottomShadowPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
XmNforeground | XmCForeground | Pixel | dynamic | CSG |
XmNhelpCallback | XmCCallback | XtCallbackList | NULL | C |
XmNhighlightColor | XmCHighlightColor | Pixel | dynamic | CSG |
XmNhighlightPixmap | XmCHighlightPixmap | Pixmap | dynamic | CSG |
XmNinitialFocus | XmCInitialFocus | Widget | dynamic | CSG |
XmNlayoutDirection | XmCLayoutDirection | XmDirection | dynamic | CG |
XmNnavigationType | XmCNavigationType | XmNavigationType | XmTAB_GROUP | CSG |
XmNpopupHandlerCallback | XmCCallback | XtCallbackList | NULL | C |
XmNshadowThickness | XmCShadowThickness | Dimension | dynamic | CSG |
XmNstringDirection | XmCStringDirection | XmStringDirection | dynamic | CG |
XmNtopShadowColor | XmCTopShadowColor | Pixel | dynamic | CSG |
XmNtopShadowPixmap | XmCTopShadowPixmap | Pixmap | dynamic | CSG |
XmNtraversalOn | XmCTraversalOn | Boolean | True | CSG |
XmNunitType | XmCUnitType | unsigned char | dynamic | CSG |
XmNuserData | XmCUserData | XtPointer | NULL | CSG |
Composite Resource Set | ||||
Name | Class | Type | Default | Access |
XmNchildren | XmCReadOnly | WidgetList | NULL | G |
XmNinsertPosition | XmCInsertPosition | XtOrderProc | NULL | CSG |
XmNnumChildren | XmCReadOnly | Cardinal | 0 | G |
Core Resource Set | ||||
Name | Class | Type | Default | Access |
XmNaccelerators | XmCAccelerators | XtAccelerators | dynamic | N/A |
XmNancestorSensitive | XmCSensitive | Boolean | dynamic | G |
XmNbackground | XmCBackground | Pixel | dynamic | CSG |
XmNbackgroundPixmap | XmCPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
XmNborderColor | XmCBorderColor | Pixel | XtDefaultForeground | CSG |
XmNborderPixmap | XmCPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
XmNborderWidth | XmCBorderWidth | Dimension | 0 | CSG |
XmNcolormap | XmCColormap | Colormap | dynamic | CG |
XmNdepth | XmCDepth | int | dynamic | CG |
XmNdestroyCallback | XmCCallback | XtCallbackList | NULL | C |
XmNheight | XmCHeight | Dimension | dynamic | CSG |
XmNinitialResourcesPersistent | XmCInitialResourcesPersistent | Boolean | True | C |
XmNmappedWhenManaged | XmCMappedWhenManaged | Boolean | True | CSG |
XmNscreen | XmCScreen | Screen * | dynamic | CG |
XmNsensitive | XmCSensitive | Boolean | True | CSG |
XmNtranslations | XmCTranslations | XtTranslations | dynamic | CSG |
XmNwidth | XmCWidth | Dimension | dynamic | CSG |
XmNx | XmCPosition | Position | 0 | CSG |
XmNy | XmCPosition | Position | 0 | CSG |
A pointer to the following structure is passed to each callback:
typedef struct {
int reason;
XEvent *event; } XmAnyCallbackStruct;
XmMessageBox includes the translations from XmManager.
The XmMessageBox widget has the following additional behavior:
The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see VirtualBindings(3).
Composite(3), Constraint(3), Core(3), XmBulletinBoard(3), XmCreateErrorDialog(3), XmCreateInformationDialog(3), XmCreateMessageBox(3), XmCreateMessageDialog(3), XmCreateQuestionDialog(3), XmCreateTemplateDialog(3), XmCreateWarningDialog(3), XmCreateWorkingDialog(3), XmManager(3), XmMessageBoxGetChild(3), XmVaCreateMessageBox(3), and XmVaCreateManagedMessageBox(3).