XMMENUSHELL(3)
π XmMenuShell(3) π
okay so bestie, meet XmMenuShell β the MenuShell widget class. It's a custom OverrideShell widget, and it's literally built to hold Popup or Pulldown menu panes. The vibes? Immaculate. Let's go π«Ά
β¨ NAME β¨
XmMenuShell β The MenuShell widget class π
πΈ SYNOPSIS πΈ
#include <Xm/MenuShell.h>
π DESCRIPTION π
The MenuShell widget is a custom OverrideShell widget. An OverrideShell widget bypasses mwm when displaying itself. It is designed specifically to contain Popup or Pulldown menu panes.
Most application writers never encounter this widget if they use the menu-system convenience functions, XmCreatePopupMenu or XmCreatePulldownMenu, to create a Popup or Pulldown menu pane. The convenience functions automatically create a MenuShell widget as the parent of the menu pane. However, if the convenience functions are not used, the application programmer must create the required MenuShell. In this case, it is important to note that the parent of the MenuShell depends on the type of menu system being built.
- If the MenuShell is for the top-level Popup menu pane, the MenuShell's parent must be the widget from which the Popup menu pane is popped up.
- If the MenuShell is for a menu pane that is pulled down from a Popup or another Pulldown menu pane, the MenuShell's parent must be the Popup or Pulldown menu pane.
- If the MenuShell is for a menu pane that is pulled down from a MenuBar, the MenuShell's parent must be the MenuBar.
- If the MenuShell is for a Pulldown menu pane in an OptionMenu, the MenuShell's parent must be the OptionMenu's parent.
Setting XmNheight, XmNwidth, or XmNborderWidth for either a MenuShell or its child sets that resource to the same value in both the parent and the child. An application should always specify these resources for the child, not the parent.
For the managed child of a MenuShell, regardless of the value of the shell's XmNallowShellResize, setting XmNx or XmNy sets the corresponding resource of the parent but does not change the child's position relative to the parent. XtGetValues for the child's XmNx or XmNy yields the value of the corresponding resource in the parent. The x and y-coordinates of the child's upper left outside corner relative to the parent's upper left inside corner are both 0 (zero) minus the value of XmNborderWidth.
MenuShell uses the XmQTmenuSystem trait and holds the XmQTspecifyRenderTable trait.
π Classes π
MenuShell inherits behavior, resources, and traits from Core, Composite, Shell, and OverrideShell.
The class pointer is xmMenuShellWidgetClass.
The class name is XmMenuShell.
β¨ New Resources β¨
MenuShell overrides the XmNallowShellResize resource in Shell. 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).
π XmMenuShell Resource Set π
XmNbuttonFontListβ Class:XmCButtonFontListΒ· Type:XmFontListΒ· Default:dynamicΒ· Access:CSGXmNbuttonRenderTableβ Class:XmCButtonRenderTableΒ· Type:XmRenderTableΒ· Default:NULLΒ· Access:CSGXmNdefaultFontListβ Class:XmCDefaultFontListΒ· Type:XmFontListΒ· Default:dynamicΒ· Access:CGXmNlabelFontListβ Class:XmCLabelFontListΒ· Type:XmFontListΒ· Default:dynamicΒ· Access:CSGXmNlabelRenderTableβ Class:XmCLabelRenderTableΒ· Type:XmRenderTableΒ· Default:NULLΒ· Access:CSGXmNlayoutDirectionβ Class:XmCLayoutDirectionΒ· Type:XmDirectionΒ· Default:XmLEFT_TO_RIGHTΒ· Access:CGXmNanimateβ Class:XmCAnimateΒ· Type:BooleanΒ· Default:FalseΒ· Access:CG
π¦ Resource Descriptions π¦
XmNbuttonFontListβ Specifies the font list used for button descendants. See theXmNbuttonRenderTableresource.XmNbuttonRenderTableβ Specifies the render table used for MenuShell's button descendants. If this value isNULLat initialization and if the value ofXmNdefaultFontListis notNULL,XmNbuttonRenderTableis initialized to the value ofXmNdefaultFontList. If the value ofXmNdefaultFontListisNULL,XmNbuttonRenderTableis initialized by looking up the parent hierarchy of the widget for an ancestor that holds theXmQTspecifyRenderTabletrait. If such an ancestor is found,XmNbuttonRenderTableis initialized to theXmBUTTON_RENDER_TABLEvalue of the ancestor widget. If no such ancestor is found, the default is implementation dependent. Refer toXmRenderTable(3)for more information on the creation and structure of a render table.XmNdefaultFontListβ Specifies a default font list for MenuShell's descendants. This resource is obsolete and exists for compatibility with earlier releases. It has been replaced byXmNbuttonFontListandXmNlabelFontList.XmNlabelFontListβ Specifies the font list used for label descendants. See theXmNlabelRenderTableresource.XmNlabelRenderTableβ Specifies the render table used for MenuShell's label descendants (Labels and LabelGadgets). If this value isNULLat initialization and if the value ofXmNdefaultFontListis notNULL,XmNlabelRenderTableis initialized to the value ofXmNdefaultFontList. If the value ofXmNdefaultFontListisNULL, the parent hierarchy of the widget is searched for an ancestor that holds theXmQTspecifyRenderTabletrait. If such an ancestor is found,XmNlabelRenderTableis initialized to theXmLABEL_RENDER_TABLEvalue of the ancestor widget. If no such ancestor is found, the default is implementation dependent. Refer toXmRenderTable(3)for more information on the creation and structure of a render table.XmNlayoutDirectionβ Specifies the direction in which the subwidgets, children of a widget, or other visual components are to be laid out. This policy will apply as the default layout policy for all descendants of this MenuShell.XmNanimateβ Controls whether menus will post in an animated fashion.
π¦ Inherited Resources π¦
MenuShell 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. The programmer can set the resource values for these 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).
π Shell Resource Set π
okay bestie, here's the whole Shell resource set, every single one, no skips, no cap. For each one I'm giving you the name, the class, the type, the default, and the access code β exactly like the original says, just with way more β¨energyβ¨.
XmNallowShellResizeβ classXmCAllowShellResize, typeBoolean, defaultTrue, accessG. she's permissive and she's defaulting to yes πXmNcreatePopupChildProcβ classXmCCreatePopupChildProc, typeXtCreatePopupChildProc, defaultNULL, accessCSG.XmNgeometryβ classXmCGeometry, typeString, defaultNULL, accessCSG. a whole string, and it starts out empty, iconicXmNoverrideRedirectβ classXmCOverrideRedirect, typeBoolean, defaultTrue, accessCSG. π¦XmNpopdownCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC.XmNpopupCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC.XmNsaveUnderβ classXmCSaveUnder, typeBoolean, defaultTrue, accessCSG. defaults to True, saving that under, we love a prepared queen πΈXmNvisualβ classXmCVisual, typeVisual *, defaultCopyFromParent, accessCSG. note the literal star in the type, bestie, it'sVisual *, do not lose the star β
fr fr, those little access letters (G,CSG,C) are part of the table and I'm keeping them exactly as they came, no edits, no opinions, no guessing π
β¨ Composite Resource Set β¨
and now the Composite resource set, only three of them, short and sweet, main character energy π
XmNchildrenβ classXmCReadOnly, typeWidgetList, defaultNULL, accessG. read-only and giving nothing but aNULLdefault πXmNinsertPositionβ classXmCInsertPosition, typeXtOrderProc, defaultNULL, accessCSG.XmNnumChildrenβ classXmCReadOnly, typeCardinal, default0, accessG. zero, as in no children yet, we're manifesting π«Ά
and yes,XmNchildrenandXmNnumChildrenare both read-only (G), whileXmNinsertPositionisCSGβ that's literally what the table says, iykyk π§
π Core Resource Set π
okay bestie, here's the whole core resource lineup β every single one, no skips, I promise π Each bullet gives you the resource name, its class, its type, its default, and its access. That's the whole vibe check, five for five, every time.
XmNacceleratorsβ classXmCAccelerators, typeXtAccelerators, defaultdynamic, accessCSGβ¨XmNancestorSensitiveβ classXmCSensitive, typeBoolean, defaultdynamic, accessGXmNbackgroundβ classXmCBackground, typePixel, defaultdynamic, accessCSGπXmNbackgroundPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNborderColorβ classXmCBorderColor, typePixel, defaultXtDefaultForeground, accessCSGXmNborderPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNborderWidthβ classXmCBorderWidth, typeDimension, default0, accessCSGXmNcolormapβ classXmCColormap, typeColormap, defaultdynamic, accessCGπΈXmNdepthβ classXmCDepth, typeint, defaultdynamic, accessCGXmNdestroyCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNheightβ classXmCHeight, typeDimension, defaultdynamic, accessCSGXmNinitialResourcesPersistentβ classXmCInitialResourcesPersistent, typeBoolean, defaultTrue, accessCπXmNmappedWhenManagedβ classXmCMappedWhenManaged, typeBoolean, defaultTrue, accessCSGXmNscreenβ classXmCScreen, typeScreen *, defaultdynamic, accessCGπ¦XmNsensitiveβ classXmCSensitive, typeBoolean, defaultTrue, accessCSGXmNtranslationsβ classXmCTranslations, typeXtTranslations, defaultdynamic, accessCSGXmNwidthβ classXmCWidth, typeDimension, defaultdynamic, accessCSGXmNxβ classXmCPosition, typePosition, default0, accessCSGXmNyβ classXmCPosition, typePosition, default0, accessCSGβ
β¨ Translations β¨
The XmMenuShell translations live in the little list right below, and honestly? iconic. π
So the key names here follow the X standard key event translation table syntax β that's the exact format Motif uses to say which widget actions go with which key. If you want the quick-and-dirty overview of how that format works, go peek at VirtualBindings(3). And if you want the whole deep dive, fr fr, the place to be is the X Toolkit Instrinsics Documentation (yes, that spelling, I'm just relaying it bestie, don't come for me π).
<BtnDown>:
ClearTraversal()
<BtnUp>: MenuShellPopdownDone()
π Action Routines π
And these are the XmMenuShell action routines β the actual moves π
ClearTraversal()β Disables keyboard traversal for the menu, enables mouse traversal, and unposts any menus that were posted by this menu. Basically: keyboard's out, mouse is in, and any menu this one popped up gets taken back down. π«ΆMenuShellPopdownDone()β Unposts the whole menu hierarchy, and when the shell's keyboard focus policy isXmEXPLICIT, it restores focus right back to the widget that had focus before the menu system was ever entered. So it's giving "rewind, put it back exactly how you found it" energy. π₯
πΈ MenuShellPopdownOne() πΈ
okay bestie, this one is THE un-post button and it behaves differently depending on where it lives, so pay attention π
- In a top-level Pulldown MenuPane from a MenuBar β it unposts the menu, disarms the
MenuBar CascadeButtonand theMenuBar, and, when the shell's keyboard focus policy isXmEXPLICIT, it restores keyboard focus to the widget that had the focus before theMenuBarwas entered. it's giving "put it back exactly how you found it" β¨ - In other Pulldown MenuPanes β this action just unposts the menu. that's it. that's the whole job π«Ά
- In a Popup MenuPane β it unposts the menu, and, when the shell's keyboard focus policy is
XmEXPLICIT, it restores keyboard focus to the widget from which the menu was posted π₯
β¨ Virtual Bindings β¨
ngl, the bindings for virtual keys are vendor specific β so like, don't come for me, every vendor does their own thing π
for the deets on bindings for virtual buttons and keys, go read VirtualBindings(3). iconic reference, go look π
π RELATED π
the whole friend group, no cap:
Composite(3)Core(3)OverrideShell(3)Shell(3)XmCreateMenuShell(3)XmCreatePopupMenu(3)XmCreatePulldownMenu(3)XmRowColumn(3)
and that's a wrap on the whole page, bestie π this one's from the XmMenuShell(library call) family β that footer is literally the source/version tag, so if you're citing it, that's your receipt π go forth and post and unpost those menus like the main character you are β¨π
π¦ 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