XMCASCADEBUTTON(3)
π XmCascadeButton π β the CascadeButton widget class
okay bestie, gather round, because this is the XmCascadeButton(library call) page and she is iconic π
. This is the widget class doc, and yes it's a long one, so we're doing it in parts. Part 1 starts now π«Ά
β¨ SYNOPSIS β¨
#include <Xm/CascadeB.h>
πΈ DESCRIPTION πΈ
So what is a CascadeButton? Bestie, it links two menu panes together, or links a MenuBar to a menu pane. That's her whole job and she does it flawlessly β¨.
She lives in menu systems, and the way that she must have a RowColumn parent with its XmNrowColumnType resource set to XmMENU_BAR, XmMENU_POPUP or XmMENU_PULLDOWN β no cap, that's non-negotiable.
She is the only widget that can have a Pulldown menu pane attached to it as a submenu π. That submenu pops up when this widget is activated inside a MenuBar, a PopupMenu, or a PulldownMenu. Her visuals? Depends where she's at:
- when she's in a Popup or Pulldown menu pane, she can show a label or pixmap and a cascading indicator
- when she's in a MenuBar, she can show only a label or a pixmap
Where the PulldownMenu sits relative to the CascadeButton is up to the XmNlayoutDirection resource of the MenuShell. Slay.
The default behavior of a CascadeButton depends on what kind of menu system she's in. By default, BSelect controls her behavior. Also, BMenu controls her behavior if she resides in a PopupMenu system. The actual mouse button used is determined by her RowColumn parent. And BMenu also performs the BSelect actions in all types of menu systems, iykyk.
Her visuals differ from most other button gadgets, and honestly it's giving main character energy. When the button becomes armed, her visuals change from a 2-D to a 3-D look, and she displays the submenu attached to her. If no submenu is attached, she just changes her visuals and that's it π.
Now, when a CascadeButton in a Pulldown or Popup menu pane gets armed because the user moved the mouse pointer into the widget, she does not immediately display her submenu. Instead she waits a short amount of time to see if the arming was temporary (like, the user was just passing through the widget) or whether the user really wanted the submenu posted. That time delay is configurable using XmNmappingDelay. Patient queen π.
CascadeButton gives you exactly one mechanism for activating the widget from the keyboard, and it's called a keyboard mnemonic. If a mnemonic has been specified for the widget, the user can activate the CascadeButton by simply typing the mnemonic while the CascadeButton is visible. If the CascadeButton is in a MenuBar and the MenuBar does not have the focus, the MAlt modifier must be pressed along with the mnemonic. Mnemonics are typically used to interact with a menu using the keyboard interface. Periodt.
One more thing: if the CascadeButton is in a Pulldown or Popup menu pane and there is a submenu attached, the XmNmarginBottom, XmNmarginLeft, XmNmarginRight, and XmNmarginTop resources may enlarge to accommodate XmNcascadePixmap. And XmNmarginWidth defaults to 6 if this resource is in a MenuBar; otherwise, it takes Label's default, which is 2. Noted π.
CascadeButton uses the XmQTmenuSystem and XmQTspecifyRenderTable traits. Obsessed with her.
π¦ Classes π¦
CascadeButton inherits behavior, resources, and traits from the Core, XmPrimitive, and XmLabel classes. Family tree, we love to see it π.
- The class pointer is
xmCascadeButtonWidgetClass. - The class name is
XmCascadeButton.
π New Resources π
Okay so this next bit is a set of widget resources that the programmer uses to specify data. The programmer can also set the resource values for the inherited classes to set attributes for this widget. Here's the vibe:
- To reference a resource by name or by class in a
.Xdefaultsfile, remove theXmNorXmCprefix and use the remaining letters. - To specify one of the defined values for a resource in a
.Xdefaultsfile, remove theXmprefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words).
The codes in the access column tell you whether the resource can be:
- set at creation time (
C) - set by using
XtSetValues(S) - retrieved by using
XtGetValues(G) - or is not applicable (
N/A)
π XmCascadeButton Resource Set π
XmNactivateCallbackβ Class:XmCCallback; Type:XtCallbackList; Default:NULL; Access:CXmNcascadePixmapβ Class:XmCPixmap; Type:Pixmap; Default:dynamic; Access:CSGXmNcascadingCallbackβ Class:XmCCallback; Type:XtCallbackList; Default:NULL; Access:CXmNmappingDelayβ Class:XmCMappingDelay; Type:int; Default:180 ms; Access:CSGXmNsubMenuIdβ Class:XmCMenuWidget; Type:Widget; Default:NULL; Access:CSG
π The resources, one by one π
XmNactivateCallbackβ Specifies the list of callbacks that is called when the user activates the CascadeButton widget and there is no submenu attached to pop up. The activation occurs when a mouse button is released or when the mnemonic associated with the widget is typed. The specific mouse button depends on information in the RowColumn parent. The reason sent by the callback isXmCR_ACTIVATE.XmNcascadePixmapβ Specifies the cascade pixmap displayed on one end of the widget when a CascadeButton is used within a Popup or Pulldown menu pane and a submenu is attached. The Label class resourcesXmNmarginBottom,XmNmarginLeft,XmNmarginRight, andXmNmarginTopmay be modified to ensure that room is left for the cascade pixmap. The default cascade pixmap is an arrow pointing to the side of the menu where the submenu will appear. The positioning of the cascade pixmap to either the left or the right of the widget, and the direction of the arrow, depend on theXmNlayoutDirectionresource of the MenuShell.XmNcascadingCallbackβ Specifies the list of callbacks that is called just prior to the mapping of the submenu associated with CascadeButton. The reason sent by the callback isXmCR_CASCADING.XmNmappingDelayβ Specifies the amount of time, in milliseconds, between when a CascadeButton becomes armed and when it maps its submenu. This delay is used only when the widget is within a Popup or Pulldown menu pane. The value must not be negative.
π¨ bestie listen: that value must not be negative. Do not test her on this.
XmNsubMenuIdβ Specifies the widget ID for the Pulldown menu pane to be associated with this CascadeButton. The specified menu pane is displayed when the CascadeButton becomes armed. The menu pane must have been created with the appropriate parentage depending on the type of menu used. SeeXmCreateMenuBar(3),XmCreatePulldownMenu(3), andXmCreatePopupMenu(3)for more information on the menu systems.
π Inherited Resources π
CascadeButton 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 tables are coming, bestie β keep scrolling π)
β¨ XmLabel Resource Set β¨
okay so XmCascadeButton is a whole XmLabel underneath the glitter, which means it inherits the entire XmLabel resource set. Every row here has a Name, a Class, a Type, a Default, and an Access β and I'm listing every single one, no skipping, bestie. π
XmNacceleratorβ classXmCAccelerator, typeString, defaultNULL, accessN/A.XmNacceleratorTextβ classXmCAcceleratorText, typeXmString, defaultNULL, accessN/A.XmNalignmentβ classXmCAlignment, typeunsigned char, defaultdynamic, accessCSG.XmNfontListβ classXmCFontList, typeXmFontList, defaultdynamic, accessCSG.XmNlabelInsensitivePixmapβ classXmCLabelInsensitivePixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG.XmNlabelPixmapβ classXmCLabelPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG.XmNlabelStringβ classXmCXmString, typeXmString, defaultdynamic, accessCSG.XmNlabelTypeβ classXmCLabelType, typeunsigned char, defaultXmSTRING, accessCSG.XmNmarginBottomβ classXmCMarginBottom, typeDimension, defaultdynamic, accessCSG.XmNmarginHeightβ classXmCMarginHeight, typeDimension, default2, accessCSG.XmNmarginLeftβ classXmCMarginLeft, typeDimension, default0, accessCSG.XmNmarginRightβ classXmCMarginRight, typeDimension, defaultdynamic, accessCSG.XmNmarginTopβ classXmCMarginTop, typeDimension, defaultdynamic, accessCSG.XmNmarginWidthβ classXmCMarginWidth, typeDimension, defaultdynamic, accessCSG.XmNmnemonicβ classXmCMnemonic, typeKeySym, defaultNULL, accessCSG.XmNmnemonicCharSetβ classXmCMnemonicCharSet, typeString, defaultXmFONTLIST_DEFAULT_TAG, accessCSG.XmNrecomputeSizeβ classXmCRecomputeSize, typeBoolean, defaultTrue, accessCSG.XmNrenderTableβ classXmCRenderTable, typeXmRenderTable, defaultdynamic, accessCSG.XmNstringDirectionβ classXmCStringDirection, typeXmStringDirection, defaultdynamic, accessCSG.
quick vibe check on that table: most of these are CSG access, which is the classic "set it whenever, get it whenever, and it plays nice with the rest of the resource gang" energy. π«Ά The two N/A rows up top are XmNaccelerator and XmNacceleratorText β that's literally what the Access column says, so don't come for me. And a whole bunch of the defaults say dynamic, which is Motif's way of going "it depends, babe, we'll figure it out at runtime" β¨
more coming, don't go anywhere π
πΈ XmPrimitive Resource Set πΈ
okay bestie, this is the whole resource roster for <pink>XmPrimitive</pink> β every name, class, type, default and access code, laid out for you π so you don't have to squint at a giant table. here we go:
XmNbottomShadowColorβ classXmCBottomShadowColor, typePixel, defaultdynamic, accessCSGβ¨XmNbottomShadowPixmapβ classXmCBottomShadowPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGβ¨XmNconvertCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCπXmNforegroundβ classXmCForeground, typePixel, defaultdynamic, accessCSGβ¨XmNhelpCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCπXmNhighlightColorβ classXmCHighlightColor, typePixel, defaultdynamic, accessCSGβ¨XmNhighlightOnEnterβ classXmCHighlightOnEnter, typeBoolean, defaultFalse, accessCSGπ¦XmNhighlightPixmapβ classXmCHighlightPixmap, typePixmap, defaultdynamic, accessCSGβ¨XmNhighlightThicknessβ classXmCHighlightThickness, typeDimension, default0, accessCSGπΈXmNlayoutDirectionβ classXmCLayoutDirection, typeXmDirection, defaultdynamic, accessCGπXmNnavigationTypeβ classXmCNavigationType, typeXmNavigationType, defaultXmNONE, accessCSGπ§XmNpopupHandlerCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCπXmNshadowThicknessβ classXmCShadowThickness, typeDimension, default2, accessCSGπXmNtopShadowColorβ classXmCTopShadowColor, typePixel, defaultdynamic, accessCSGβ¨XmNtopShadowPixmapβ classXmCTopShadowPixmap, typePixmap, defaultdynamic, accessCSGβ¨XmNtraversalOnβ classXmCTraversalOn, typeBoolean, defaultdynamic, accessGπXmNunitTypeβ classXmCUnitType, typeunsigned char, defaultdynamic, accessCSGπXmNuserDataβ classXmCUserData, typeXtPointer, defaultNULL, accessCSGπ
fr fr bestie, notice how some defaults literally saydynamicinstead of a fixed value? that's not me being vague, that's the actual default. and the access column isC,CSG,CGorGβ keep those exactly as they are, don't go freestyling them π
and yes, every single one of these has its Name / Class / Type / Default / Access preserved exactly as the original table had it. no cap. π«Ά
β¨ Core Resource Set β¨
ok so here's the whole resource lineup for XmCascadeButton, bestie π every single one, name + class + type + default + access, no skips:
XmNacceleratorsβ classXmCAccelerators, typeXtAccelerators, defaultdynamic, accessCSGXmNancestorSensitiveβ 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 gets handed a pointer to this lil struct right here, no cap:
typedef struct
{
int reason;
XEvent * event;
} XmAnyCallbackStruct;
reasonβ spills the tea on why the callback got invoked πeventβ points at theXEventthat triggered the callback, OR it'sNULLif this callback wasn't triggered by anXEventat all. (not every callback is an event girlie, and that's fine π«Ά)
π¦ Translations
XmCascadeButton comes with translations inherited from XmPrimitive, periodt. And it also picks up the menu traversal translations from XmLabel. it's giving family reunion π
π¨ undefined behavior alert, bestie!! altering translations in#overrideor#augmentmode is undefined. do not do it. i am begging. π
ok so here's the translations tea for a CascadeButton chillin inside a MenuBar. the key names below are written in the X standard key event translation table syntax β that's the format Motif uses to say which widget actions match up with a given key. there's a lil overview of the format over in VirtualBindings(3), and if you want the full description, go read the X Toolkit Instrinsics Documentation. iykyk πβ¨
<EnterWindow>Normal:
MenuBarEnter()
<LeaveWindow>Normal:
MenuBarLeave()
<Btn2Down>:
ProcessDrag()
c<BtnDown>:
MenuButtonTakeFocusUp()
c<BtnUp>: MenuButtonTakeFocusUp()
okay so picking up right where we left off, the translation list goes:
βΌc<BtnDown>:βMenuBarSelect()πβΌc<BtnUp>:βDoSelect()β¨:<Key><osfSelect>:βKeySelect()π:<Key><osfActivate>:βKeySelect()π¦:<Key><osfHelp>:βHelp()πΈ:<Key><osfCancel>:βCleanupMenuBar()πβΌs<Key>Return:βKeySelect()π«ΆβΌs<Key>space:βKeySelect()π
So this next list is the translations for a CascadeButton when it's in a PullDown or Popup MenuPane. And in a Popup menu system, <Btn3> also does the <Btn1> actions, periodt. π₯
<EnterWindow>:βDelayedArm()π§<LeaveWindow>:βCheckDisarm()π<Btn2Down>:βProcessDrag()πc<BtnDown>:βMenuButtonTakeFocus()πc<BtnUp>:βMenuButtonTakeFocusUp()πβΌc<BtnDown>:βStartDrag()ββΌc<BtnUp>:βDoSelect()β¨:<Key><osfSelect>:βKeySelect()π:<Key><osfActivate>:βKeySelect()π¦:<Key><osfHelp>:βHelp()πΈ:<Key><osfCancel>:βCleanupMenuBar()πβΌs<Key>Return:βKeySelect()π«ΆβΌs<Key>space:βKeySelect()π
β¨ Action Routines β¨
The XmCascadeButton action routines are literally the moment. Here's every single one, no skips:
CleanupMenuBar()β bestie, this one is the menu cleanup queen π. Here's the tea:- In a MenuBar, it disarms the CascadeButton and the menu and, when the shell's keyboard focus policy is
XmEXPLICIT, restores keyboard focus to the widget that had the focus before the menu was entered. - In a toplevel Pulldown MenuPane from a MenuBar, it unposts the menu, disarms the MenuBar CascadeButton and the MenuBar, and, when the shell's keyboard focus policy is
XmEXPLICIT, restores keyboard focus to the widget that had the focus before the MenuBar was entered. In other Pulldown MenuPanes, it unposts the menu. - In a Popup MenuPane, it unposts the menu and, when the shell's keyboard focus policy is
XmEXPLICIT, restores keyboard focus to the widget from which the menu was posted.
- In a MenuBar, it disarms the CascadeButton and the menu and, when the shell's keyboard focus policy is
DoSelect()β Calls the callbacks inXmNcascadingCallback, posts the submenu attached to the CascadeButton, and enables keyboard traversal within the menu. If the CascadeButton does not have a submenu attached, this action calls the callbacks inXmNactivateCallback, activates the CascadeButton, and unposts all posted menus in the cascade. slay. πHelp()β Unposts all menus in the menu hierarchy and, when the shell's keyboard focus policy isXmEXPLICIT, restores keyboard focus to the widget that had the focus before the menu system was entered. Calls the callbacks forXmNhelpCallbackif any exist. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them. helpful icon behavior fr fr. πKeySelect()β Calls the callbacks inXmNcascadingCallback, and posts the submenu attached to the CascadeButton if keyboard traversal is enabled in the menu. If the CascadeButton does not have a submenu attached, this action calls the callbacks inXmNactivateCallback, activates the CascadeButton, and unposts all posted menus in the cascade. keyboard girlies stay winning. β¨οΈMenuBarSelect()β Unposts any menus posted by the parent menu. Arms both the CascadeButton and the MenuBar, posts the associated submenu, and enables mouse traversal. If the menu is already active, this event disables keyboard traversal for the menu and returns the menu to mouse traversal mode. mouse mode vs keyboard mode, the eternal vibe check. πStartDrag()β Arms the CascadeButton, posts the associated submenu, and enables mouse traversal. If the menu is already active, this event disables keyboard traversal for the menu and returns the menu to mouse traversal mode. drag energy activated. π₯
π« Additional Behavior π«
Posting a submenu calls the XmNcascadingCallback callbacks. This widget has the following additional behavior:
<EnterWindow>:β If keyboard traversal is enabled, does nothing. Otherwise, in a MenuBar that is armed, unposts any MenuPanes associated with another MenuBar entry, arms the CascadeButton, and posts the associated submenu. In other menus, arms the CascadeButton and posts the associated submenu after the delay specified byXmNmappingDelay. the mapping delay is lowkey the drama timer. β³<LeaveWindow>:β If keyboard traversal is enabled does nothing. Otherwise, in a MenuBar that is armed, disarms the CascadeButton if the submenu associated with the CascadeButton is not currently posted or if there is no submenu associated with the CascadeButton. In other menus, if the pointer moves anywhere except into a submenu associated with the CascadeButton, the CascadeButton is disarmed and its submenu is unposted. leave the window, lose the arm. simple as that. π
π¦ Virtual Bindings π¦
The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see VirtualBindings(3). vendor specific means it's giving "ask your distro," bestie. π
π RELATED π
Core(3)XmCascadeButtonHighlight(3)XmCreateCascadeButton(3)XmCreateMenuBar(3)XmCreatePulldownMenu(3)XmCreatePopupMenu(3)XmLabel(3)XmPrimitive(3)XmRowColumn(3)XmVaCreateCascadeButton(3)XmVaCreateManagedCascadeButton(3)
xoxo from the XmCascadeButton(library call) bestie π that's the whole vibe, and you ate. πβ¨
π¦ 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