XMMESSAGEBOX(3)
π NAME π
XmMessageBox β The MessageBox widget class. This is the XmMessageBox(library call) page, bestie, and we're about to get into it. β¨
β¨ SYNOPSIS β¨
#include <Xm/MessageB.h>
πΈ DESCRIPTION πΈ
Okay so MessageBox is a dialog class, and its whole vibe is creating simple message dialogs. There are convenience dialogs built on top of MessageBox 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:
- The first
MenuBarchild is placed at the top of the window. TheXmQTmenuSystemtrait is used to check that it is the firstMenuBarchild. - All widgets or gadgets are placed after the
OKbutton in the order of their creation (this order is checked using theXmQTactivatabletrait). - A child that is not in the above categories is placed above the row of buttons. If a message label exists, the child is placed below the label. If a message pixmap exists, but a message label is absent, the child is placed on the same row as the pixmap. The child behaves as a work area and grows or shrinks to fill the space above the row of buttons. The layout of multiple work area children is undefined. π
At initialization, MessageBox looks for the following bitmap files:
xm_errorxm_informationxm_questionxm_workingxm_warning
See XmGetPixmap(3) for a list of the paths that are searched for these files. π₯
MessageBox uses the XmQTactivatable and XmQTmenuSystem traits.
π¦ Descendants π¦
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:
Cancelβ Class:XmPushButtonGadgetβ Identity: Cancel button - Named Descendant:
Helpβ Class:XmPushButtonGadgetβ Identity: Help button - Named Descendant:
Messageβ Class:XmLabelGadgetβ Identity: displayed message - Named Descendant:
OKβ Class:XmPushButtonGadgetβ Identity: OK button - Named Descendant:
Separatorβ Class:XmSeparatorGadgetβ Identity: dividing line between message and buttons - Named Descendant:
Symbolβ Class:XmLabelGadgetβ Identity: icon symbolizing message type
π Classes π
MessageBox inherits behavior, resources, and traits from Core, Composite, Constraint, XmManager, and XmBulletinBoard. π
The class pointer is xmMessageBoxWidgetClass.
The class name is XmMessageBox.
π New Resources π
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 β¨
okay bestie, here's the whole roster of resources this widget brings to the party π every single one, with its class, type, default, and access level, because we do NOT skip rows in this house π
XmNcancelCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNcancelLabelStringβ classXmCCancelLabelString, typeXmString, default dynamic, accessCSGXmNdefaultButtonTypeβ classXmCDefaultButtonType, typeunsigned char, defaultXmDIALOG_OK_BUTTON, accessCSGXmNdialogTypeβ classXmCDialogType, typeunsigned char, defaultXmDIALOG_MESSAGE, accessCSGXmNhelpLabelStringβ classXmCHelpLabelString, typeXmString, default dynamic, accessCSGXmNmessageAlignmentβ classXmCAlignment, typeunsigned char, defaultXmALIGNMENT_BEGINNING, accessCSGXmNmessageStringβ classXmCMessageString, typeXmString, default"", accessCSGXmNminimizeButtonsβ classXmCMinimizeButtons, typeBoolean, defaultFalse, accessCSGXmNokCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNokLabelStringβ classXmCOkLabelString, typeXmString, default dynamic, accessCSGXmNsymbolPixmapβ classXmCPixmap, typePixmap, default dynamic, accessCSG
π XmNcancelCallback
tells the widget which list of callbacks to fire when somebody clicks the cancel button π«Ά the reason that gets sent along with the callback is XmCR_CANCEL.
πΈ XmNcancelLabelString
this one is the string label sitting pretty on the cancel button β¨ and here's the thing β the default for it depends on the locale you're in. in the C locale, the default is Cancel.
now that some default localized label strings are handed out through message catalogs for the children of composite widgets, the labelString resources cannot be set on the child through default resource files π instead, the resource provided at the parent level is the one you gotta use. iykyk.
π XmNdefaultButtonType
picks which PushButton gets to be the default one π
if you hand it a value of XmDIALOG_NONE, that means there should be no default PushButton at all, periodt. these are the valid types:
XmDIALOG_CANCEL_BUTTONXmDIALOG_OK_BUTTONXmDIALOG_HELP_BUTTONXmDIALOG_NONE
π¦ XmNdialogType
sets the type of MessageBox dialog, which is what decides the default message symbol π these are the possible values for this resource:
XmDIALOG_ERRORβ indicates an ErrorDialog.XmDIALOG_INFORMATIONβ indicates an InformationDialog.XmDIALOG_MESSAGEβ indicates a MessageDialog. this is the default MessageBox dialog type, and it does not have an associated message symbol.XmDIALOG_QUESTIONβ indicates a QuestionDialog.XmDIALOG_TEMPLATEβ indicates a TemplateDialog. the TemplateDialog contains only a separator child. it does not have an associated message symbol.XmDIALOG_WARNINGβ indicates a WarningDialog.XmDIALOG_WORKINGβ indicates a WorkingDialog.
heads up bestie: if this resource gets changed withXtSetValues, the symbol bitmap gets modified to the newXmNdialogTypebitmap β unlessXmNsymbolPixmapis also being set in that same call toXtSetValues. and if the dialog type doesn't have an associated message symbol, then no bitmap will be displayed at all π
π§ XmNhelpLabelString
the string label for the help button, obviously π and yeah, the default for this resource depends on the locale. in the C locale the default is Help.
same saga as before, bestie: now that some default localized label strings are provided through message catalogs for the children of composite widgets, the labelString resources cannot be set on the child through default resource files. instead, the resource provided at the parent level must be used. iconic behavior tbh.
π XmNmessageAlignment
controls the alignment of the message Label π possible values include:
XmALIGNMENT_BEGINNING(the default)XmALIGNMENT_CENTERXmALIGNMENT_END
for the full explanation of what these values even mean, go look at the description of XmNalignment in the XmLabel reference page π
π XmNmessageString
specifies the string to be used as the message. that's it, that's the resource π
π
XmNminimizeButtons
if this is False, it sets the buttons to the width of the widest button and the height of the tallest button. if this resource is True, then button width and height are set to the preferred size of each button. little buttons, individual vibes β¨
π XmNokCallback
specifies the list of callbacks that gets called when the user clicks on the OK button π«Ά the reason sent by the callback is XmCR_OK.
β XmNokLabelString
the string label for the OK button π the default depends on the locale, and in the C locale the default is OK.
and yes, bestie, it's the same message-catalog situation again: now that some default localized label strings are provided through message catalogs for the children of composite widgets, the labelString resources cannot be set on the child through default resource files. instead, the resource provided at the parent level must be used. no cap.
π₯ XmNsymbolPixmap
specifies the pixmap label to be used as the message symbol π
π Inherited Resources
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 πΈ
okay bestie, this is the big one β the whole XmBulletinBoard resource roster. π«Ά These are the inherited ones, and they show up here with the same five columns the table had: Name, Class, Type, Default, and Access. I'm keeping every single one exactly as-is, no cap. π
XmNallowOverlapβ classXmCAllowOverlap, typeBoolean, defaultTrue, accessCSGXmNautoUnmanageβ classXmCAutoUnmanage, typeBoolean, defaultTrue, accessCGXmNbuttonFontListβ classXmCButtonFontList, typeXmFontList, defaultdynamic, accessCSGXmNbuttonRenderTableβ classXmCButtonRenderTable, typeXmRenderTable, defaultdynamic, accessCSGXmNcancelButtonβ classXmCWidget, typeWidget, defaultCancel button, accessSGXmNdefaultButtonβ classXmCWidget, typeWidget, defaultdynamic, accessSGXmNdefaultPositionβ classXmCDefaultPosition, typeBoolean, defaultTrue, accessCSGXmNdialogStyleβ classXmCDialogStyle, typeunsigned char, defaultdynamic, accessCSGXmNdialogTitleβ classXmCDialogTitle, typeXmString, defaultNULL, accessCSGXmNfocusCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNlabelFontListβ classXmCLabelFontList, typeXmFontList, defaultdynamic, accessCSGXmNlabelRenderTableβ classXmCLabelRenderTable, typeXmRenderTable, defaultdynamic, accessCSGXmNmapCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNmarginHeightβ classXmCMarginHeight, typeDimension, default10, accessCSGXmNmarginWidthβ classXmCMarginWidth, typeDimension, default10, accessCSGXmNnoResizeβ classXmCNoResize, typeBoolean, defaultFalse, accessCSGXmNresizePolicyβ classXmCResizePolicy, typeunsigned char, defaultXmRESIZE_ANY, accessCSGXmNshadowTypeβ classXmCShadowType, typeunsigned char, defaultXmSHADOW_OUT, accessCSGXmNtextFontListβ classXmCTextFontList, typeXmFontList, defaultdynamic, accessCSGXmNtextRenderTableβ classXmCTextRenderTable, typeXmRenderTable, defaultdynamic, accessCSGXmNtextTranslationsβ classXmCTranslations, typeXtTranslations, defaultNULL, accessCXmNunmapCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC
that's all 22 of them, fr fr β literally nothing dropped, nothing merged, every class and default copied character for character π
and yeah, notice how many of these are dynamic for the default β that's a whole thing and it comes up again later, so hold that thought bestie π¦
β¨ XmManager Resource Set β¨
okay bestie, here's the whole resource set this widget inherits from XmManager β every name, class, type, default and access mode, no skips π
XmNbottomShadowColorβ classXmCBottomShadowColor, typePixel, defaultdynamic, accessCSGXmNbottomShadowPixmapβ classXmCBottomShadowPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNforegroundβ classXmCForeground, typePixel, defaultdynamic, accessCSGXmNhelpCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNhighlightColorβ classXmCHighlightColor, typePixel, defaultdynamic, accessCSGXmNhighlightPixmapβ classXmCHighlightPixmap, typePixmap, defaultdynamic, accessCSGXmNinitialFocusβ classXmCInitialFocus, typeWidget, defaultdynamic, accessCSGXmNlayoutDirectionβ classXmCLayoutDirection, typeXmDirection, defaultdynamic, accessCGXmNnavigationTypeβ classXmCNavigationType, typeXmNavigationType, defaultXmTAB_GROUP, accessCSGXmNpopupHandlerCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNshadowThicknessβ classXmCShadowThickness, typeDimension, defaultdynamic, accessCSGXmNstringDirectionβ classXmCStringDirection, typeXmStringDirection, defaultdynamic, accessCGXmNtopShadowColorβ classXmCTopShadowColor, typePixel, defaultdynamic, accessCSGXmNtopShadowPixmapβ classXmCTopShadowPixmap, typePixmap, defaultdynamic, accessCSGXmNtraversalOnβ classXmCTraversalOn, typeBoolean, defaultTrue, accessCSGXmNunitTypeβ classXmCUnitType, typeunsigned char, defaultdynamic, accessCSGXmNuserDataβ classXmCUserData, typeXtPointer, defaultNULL, accessCSG
β¨ Composite Resource Set β¨
and these are the ones it gets from Composite β tiny little set, but they matter π«Ά
XmNchildrenβ classXmCReadOnly, typeWidgetList, defaultNULL, accessGXmNinsertPositionβ classXmCInsertPosition, typeXtOrderProc, defaultNULL, accessCSGXmNnumChildrenβ classXmCReadOnly, typeCardinal, default0, accessG
β¨ Core Resource Set β¨
bestie. sit down. hydrate. we're doing the whole resource table and I am not skipping a single line of it π Every resource name, its class, its type, its default and its access code are all right here β copy them exactly, because X is that picky.
XmNacceleratorsβ classXmCAccelerators, typeXtAccelerators, defaultdynamic, accessN/AXmNancestorSensitiveβ classXmCSensitive, typeBoolean, defaultdynamic, accessGXmNbackgroundβ classXmCBackground, typePixel, defaultdynamic, accessCSGXmNbackgroundPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNborderColorβ classXmCBorderColor, typePixel, defaultXtDefaultForeground, accessCSGXmNborderPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNborderWidthβ classXmCBorderWidth, typeDimension, default0, accessCSGXmNcolormapβ classXmCColormap, typeColormap, defaultdynamic, accessCGXmNdepthβ classXmCDepth, typeint, defaultdynamic, accessCGXmNdestroyCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNheightβ classXmCHeight, typeDimension, defaultdynamic, accessCSGXmNinitialResourcesPersistentβ classXmCInitialResourcesPersistent, typeBoolean, defaultTrue, accessCXmNmappedWhenManagedβ classXmCMappedWhenManaged, typeBoolean, defaultTrue, accessCSGXmNscreenβ classXmCScreen, typeScreen *, defaultdynamic, accessCGXmNsensitiveβ classXmCSensitive, typeBoolean, defaultTrue, accessCSGXmNtranslationsβ classXmCTranslations, typeXtTranslations, defaultdynamic, accessCSGXmNwidthβ classXmCWidth, typeDimension, defaultdynamic, accessCSGXmNxβ classXmCPosition, typePosition, default0, accessCSGXmNyβ classXmCPosition, typePosition, default0, accessCSG
π Callback Information
Every callback you register gets handed a pointer to this lil struct, and it's giving "small but mighty":
typedef struct
{
int reason;
XEvent *event;
} XmAnyCallbackStruct;
reasonβ the whole reason the callback got summoned in the first place. it literally tells you why you're here π«Άeventβ points at theXEventthat triggered the callback. the receipts, basically.
πΈ Translations
XmMessageBox includes the translations from XmManager. that's it, that's the whole tea. inherited, no cap.
π₯ Additional Behavior
The XmMessageBox widget has some extra moves up its sleeve, and honestly? iconic behavior only:
<Key><osfCancel>β calls the activate callbacks for the cancel button, but only if it's sensitive.<Key><osfActivate>β calls the activate callbacks for whichever button has the keyboard focus. And if no button has the keyboard focus? it calls the activate callbacks for the default button instead, again only if it's sensitive.<Ok Button Activated>β calls the callbacks forXmNokCallback.<Cancel Button Activated>β calls the callbacks forXmNcancelCallback.<Help Button Activated>β calls the callbacks forXmNhelpCallback.<FocusIn>β calls the callbacks forXmNfocusCallback.<Map>β calls the callbacks forXmNmapCallbackif the parent is aDialogShell.<Unmap>β calls the callbacks forXmNunmapCallbackif the parent is aDialogShell.
heads up bestie: those last two are conditional. parent's gotta be a DialogShell or the callbacks are simply not happening π
π¦ Virtual Bindings π¦
Okay bestie, listen up, this part is important: the bindings for virtual keys are vendor specific. Like, every vendor does their own lil thing, no universal answer, no cap. π
So if you wanna know the tea about the bindings for virtual buttons and keys, go check out VirtualBindings(3) β she has the whole scoop. π«Ά
β¨ RELATED β¨
Runway walk, here's the whole friend group, all of them icons: π
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)
And that's the whole page, bestie!! You made it all the way to the end, main character energy fr fr. π This was XmMessageBox(library call) β a library call page, so it's giving "programmer's reference, but make it cute." Go forth and build those message boxes, you absolute legend. πβ¨
Mwah, thanks for reading, ily, bye!! ππ¦πΈ
π¦ where this page comes from
- alpine 3.24: motif-doc 2.5.2-r0 Β· LGPL-2.1-or-later
- arch rolling: openmotif 2.3.8-4 Β· LGPL-2.1-or-later
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- epel 10: motif-devel 2.3.8-2.el10_2 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixos 26.05: motif 2.3.8
- nixpkgs unstable: motif 2.3.8
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms