XMMESSAGEBOX(3)

πŸ“¦
version 2.5.2 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– 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 MenuBar child is placed at the top of the window. The XmQTmenuSystem trait is used to check that it is the first MenuBar child.
  • All widgets or gadgets are placed after the OK button in the order of their creation (this order is checked using the XmQTactivatable trait).
  • 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_error
  • xm_information
  • xm_question
  • xm_working
  • xm_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 β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNcancelLabelString β€” class XmCCancelLabelString, type XmString, default dynamic, access CSG
  • XmNdefaultButtonType β€” class XmCDefaultButtonType, type unsigned char, default XmDIALOG_OK_BUTTON, access CSG
  • XmNdialogType β€” class XmCDialogType, type unsigned char, default XmDIALOG_MESSAGE, access CSG
  • XmNhelpLabelString β€” class XmCHelpLabelString, type XmString, default dynamic, access CSG
  • XmNmessageAlignment β€” class XmCAlignment, type unsigned char, default XmALIGNMENT_BEGINNING, access CSG
  • XmNmessageString β€” class XmCMessageString, type XmString, default "", access CSG
  • XmNminimizeButtons β€” class XmCMinimizeButtons, type Boolean, default False, access CSG
  • XmNokCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNokLabelString β€” class XmCOkLabelString, type XmString, default dynamic, access CSG
  • XmNsymbolPixmap β€” class XmCPixmap, type Pixmap, default dynamic, access CSG

πŸ’– 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_BUTTON
  • XmDIALOG_OK_BUTTON
  • XmDIALOG_HELP_BUTTON
  • XmDIALOG_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 with XtSetValues, the symbol bitmap gets modified to the new XmNdialogType bitmap β€” unless XmNsymbolPixmap is also being set in that same call to XtSetValues. 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_CENTER
  • XmALIGNMENT_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 β€” class XmCAllowOverlap, type Boolean, default True, access CSG
  • XmNautoUnmanage β€” class XmCAutoUnmanage, type Boolean, default True, access CG
  • XmNbuttonFontList β€” class XmCButtonFontList, type XmFontList, default dynamic, access CSG
  • XmNbuttonRenderTable β€” class XmCButtonRenderTable, type XmRenderTable, default dynamic, access CSG
  • XmNcancelButton β€” class XmCWidget, type Widget, default Cancel button, access SG
  • XmNdefaultButton β€” class XmCWidget, type Widget, default dynamic, access SG
  • XmNdefaultPosition β€” class XmCDefaultPosition, type Boolean, default True, access CSG
  • XmNdialogStyle β€” class XmCDialogStyle, type unsigned char, default dynamic, access CSG
  • XmNdialogTitle β€” class XmCDialogTitle, type XmString, default NULL, access CSG
  • XmNfocusCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNlabelFontList β€” class XmCLabelFontList, type XmFontList, default dynamic, access CSG
  • XmNlabelRenderTable β€” class XmCLabelRenderTable, type XmRenderTable, default dynamic, access CSG
  • XmNmapCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNmarginHeight β€” class XmCMarginHeight, type Dimension, default 10, access CSG
  • XmNmarginWidth β€” class XmCMarginWidth, type Dimension, default 10, access CSG
  • XmNnoResize β€” class XmCNoResize, type Boolean, default False, access CSG
  • XmNresizePolicy β€” class XmCResizePolicy, type unsigned char, default XmRESIZE_ANY, access CSG
  • XmNshadowType β€” class XmCShadowType, type unsigned char, default XmSHADOW_OUT, access CSG
  • XmNtextFontList β€” class XmCTextFontList, type XmFontList, default dynamic, access CSG
  • XmNtextRenderTable β€” class XmCTextRenderTable, type XmRenderTable, default dynamic, access CSG
  • XmNtextTranslations β€” class XmCTranslations, type XtTranslations, default NULL, access C
  • XmNunmapCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C

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 β€” class XmCBottomShadowColor, type Pixel, default dynamic, access CSG
  • XmNbottomShadowPixmap β€” class XmCBottomShadowPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNforeground β€” class XmCForeground, type Pixel, default dynamic, access CSG
  • XmNhelpCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNhighlightColor β€” class XmCHighlightColor, type Pixel, default dynamic, access CSG
  • XmNhighlightPixmap β€” class XmCHighlightPixmap, type Pixmap, default dynamic, access CSG
  • XmNinitialFocus β€” class XmCInitialFocus, type Widget, default dynamic, access CSG
  • XmNlayoutDirection β€” class XmCLayoutDirection, type XmDirection, default dynamic, access CG
  • XmNnavigationType β€” class XmCNavigationType, type XmNavigationType, default XmTAB_GROUP, access CSG
  • XmNpopupHandlerCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNshadowThickness β€” class XmCShadowThickness, type Dimension, default dynamic, access CSG
  • XmNstringDirection β€” class XmCStringDirection, type XmStringDirection, default dynamic, access CG
  • XmNtopShadowColor β€” class XmCTopShadowColor, type Pixel, default dynamic, access CSG
  • XmNtopShadowPixmap β€” class XmCTopShadowPixmap, type Pixmap, default dynamic, access CSG
  • XmNtraversalOn β€” class XmCTraversalOn, type Boolean, default True, access CSG
  • XmNunitType β€” class XmCUnitType, type unsigned char, default dynamic, access CSG
  • XmNuserData β€” class XmCUserData, type XtPointer, default NULL, access CSG

✨ Composite Resource Set ✨

and these are the ones it gets from Composite β€” tiny little set, but they matter 🫢

  • XmNchildren β€” class XmCReadOnly, type WidgetList, default NULL, access G
  • XmNinsertPosition β€” class XmCInsertPosition, type XtOrderProc, default NULL, access CSG
  • XmNnumChildren β€” class XmCReadOnly, type Cardinal, default 0, access G

✨ 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 β€” class XmCAccelerators, type XtAccelerators, default dynamic, access N/A
  • XmNancestorSensitive β€” class XmCSensitive, type Boolean, default dynamic, access G
  • XmNbackground β€” class XmCBackground, type Pixel, default dynamic, access CSG
  • XmNbackgroundPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNborderColor β€” class XmCBorderColor, type Pixel, default XtDefaultForeground, access CSG
  • XmNborderPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNborderWidth β€” class XmCBorderWidth, type Dimension, default 0, access CSG
  • XmNcolormap β€” class XmCColormap, type Colormap, default dynamic, access CG
  • XmNdepth β€” class XmCDepth, type int, default dynamic, access CG
  • XmNdestroyCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNheight β€” class XmCHeight, type Dimension, default dynamic, access CSG
  • XmNinitialResourcesPersistent β€” class XmCInitialResourcesPersistent, type Boolean, default True, access C
  • XmNmappedWhenManaged β€” class XmCMappedWhenManaged, type Boolean, default True, access CSG
  • XmNscreen β€” class XmCScreen, type Screen *, default dynamic, access CG
  • XmNsensitive β€” class XmCSensitive, type Boolean, default True, access CSG
  • XmNtranslations β€” class XmCTranslations, type XtTranslations, default dynamic, access CSG
  • XmNwidth β€” class XmCWidth, type Dimension, default dynamic, access CSG
  • XmNx β€” class XmCPosition, type Position, default 0, access CSG
  • XmNy β€” class XmCPosition, type Position, default 0, access CSG

πŸ’Œ 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 the XEvent that 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 for XmNokCallback.
  • <Cancel Button Activated> β€” calls the callbacks for XmNcancelCallback.
  • <Help Button Activated> β€” calls the callbacks for XmNhelpCallback.
  • <FocusIn> β€” calls the callbacks for XmNfocusCallback.
  • <Map> β€” calls the callbacks for XmNmapCallback if the parent is a DialogShell.
  • <Unmap> β€” calls the callbacks for XmNunmapCallback if the parent is a DialogShell.
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. 🫢


Runway walk, here's the whole friend group, all of them icons: 🌈


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!! πŸ’–πŸ¦‹πŸŒΈ