XMLABEL(3)
XmLabel β the Label widget class π
library call β¨ XmLabel(library call)
okay bestie, gather round, we're doing the Label widget and it's genuinely a whole vibe. this is a library call, so it lives in the Motif/Lesstif corner of the universe π¦
β¨ NAME β¨
XmLabel β The Label widget class π
πΈ SYNOPSIS πΈ
#include <Xm/Label.h>
that's it. one include. she's low maintenance like that π
π DESCRIPTION π
okay so Label is an instantiable widget (meaning you can literally just make one, she's not abstract, she's ready π) and she ALSO serves as the superclass for other button widgets, like PushButton and ToggleButton. so she's giving both main character energy AND generous mother energy. we love a versatile icon.
here's the thing though: the Label widget does not accept any button or key input. none. zero. she does not want your clicks, she does not want your keyboard, she is simply there, looking cute. the help callback is the only callback defined. Label also receives enter and leave events, so she does notice when you hover, she's just not gonna do anything about it π
Label can contain either text or a pixmap. Label text is a compound string. (go read the Motif Programmer's Guide for the full tea on compound strings, fr fr.) the text can be multilingual, multiline, and/or multifont β she's cultured, she's stacked, she's multidimensional. when a Label is insensitive, its text is stippled, or the user-supplied insensitive pixmap is displayed instead. sad girl era, rendered in pixels π
Label supports both accelerators and mnemonics, primarily for use in Label subclass widgets that are contained in menus. here's the distinction, bestie, and it matters:
- Mnemonics are available in a menu system when the button is visible.
- Accelerators in a menu system are accessible even when the button is not visible.
the Label widget displays the mnemonic by underlining the first matching character in the text string. and the accelerator is displayed as a text string adjacent to the label text or pixmap, depending on the layout direction. slay.
Label consists of many margin fields surrounding the text or pixmap. these margin fields are resources that may be set by the user β BUT Label subclasses and Manager parents also modify some of these fields. the way that they tend to modify the XmNmarginLeft, XmNmarginRight, XmNmarginTop, and XmNmarginBottom resources and leave the XmNmarginWidth and XmNmarginHeight resources as set by the application. rude? maybe. canon? absolutely.
Label takes into account XmNshadowThickness in determining its layout but does not draw the shadow. that is, if XmNshadowThickness is greater than 0 (zero), Label leaves space for the shadow, but the shadow does not appear. she's reserving the parking spot and never pulling up π iconic honestly.
In a Label,XmNtraversalOnandXmNhighlightOnEnterare forced to False inside Popup menu panes, Pulldown menu panes, and OptionMenus. Otherwise, these resources default to False.
and for the trait girlies: Label uses the XmQTmenuSystem and XmQTspecifyRenderTable traits, and holds the XmQTaccessTextual, XmQTmenuSavvy, and XmQTtransfer traits. she's connected, she knows people β¨
π« Data Transfer Behavior π«
Label and its subclasses β except when used in a menu system β support dragging of the label contents from the Label. however! the label contents are draggable only if the XmNenableUnselectableDrag resource of XmDisplay is set to True. so flip that switch or nothing's moving, no cap.
as a source of data, Label and its subclasses support the following targets and associated conversions of data to these targets:
localeβ if the locale target matches the widget's locale, the widget transfersXmNlabelStringin the encoding of the locale. this target is supported whenXmNlabelTypeisXmSTRINGorXmPIXMAP_AND_STRING.COMPOUND_TEXTβ the widget transfersXmNlabelStringas typeCOMPOUND_TEXT. supported whenXmNlabelTypeisXmSTRINGorXmPIXMAP_AND_STRING.UTF8_STRINGβ the widget transfersXmNlabelStringas typeUTF8_STRING. supported whenXmNlabelTypeisXmSTRINGorXmPIXMAP_AND_STRING.PIXMAPβ the widget transfersXmNlabelPixmapas typeDRAWABLE. supported whenXmNlabelTypeisXmPIXMAPorXmPIXMAP_AND_STRING.STRINGβ the widget transfersXmNlabelStringas typeSTRING. supported whenXmNlabelTypeisXmSTRINGorXmPIXMAP_AND_STRING.TEXTβ ifXmNlabelStringis fully convertible to the encoding of the locale, the widget transfersXmNlabelStringin the encoding of the locale. otherwise, the widget transfersXmNlabelStringas typeCOMPOUND_TEXT. this target is supported only whenXmNlabelTypeisXmSTRINGorXmPIXMAP_AND_STRING._MOTIF_CLIPBOARD_TARGETSβ the widget transfers, as typeATOM, a list of the targets it supports for the CLIPBOARD selection. whenXmNlabelTypeisXmSTRINGorXmPIXMAP_AND_STRING, these include the following targets:_MOTIF_COMPOUND_STRINGCOMPOUND_TEXTUTF8_STRING- the encoding of the locale, if
XmNlabelStringis fully convertible to the encoding of the locale STRING, ifXmNlabelStringis fully convertible toSTRING
when XmNlabelType is XmPIXMAP or XmPIXMAP_AND_STRING, the targets include PIXMAP.
_MOTIF_COMPOUND_STRINGβ the widget transfersXmNlabelStringas a compound string in Byte Stream format. supported whenXmNlabelTypeisXmSTRINGorXmPIXMAP_AND_STRING._MOTIF_EXPORT_TARGETSβ the widget transfers, as typeATOM, a list of the targets to be used as the value of the DragContext'sXmNexportTargetsin a drag-and-drop transfer. whenXmNlabelTypeisXmSTRINGorXmPIXMAP_AND_STRING, these include_MOTIF_COMPOUND_STRING,COMPOUND_TEXT,UTF8_STRING, the encoding of the locale,STRING,TEXT,BACKGROUND, andFOREGROUND. whenXmNlabelTypeisXmPIXMAPorXmPIXMAP_AND_STRING, these includePIXMAP,BACKGROUND, andFOREGROUND.
as a source of data, Label also supports the following standard Motif targets:
BACKGROUNDβ the widget transfersXmNbackgroundas typePIXEL.CLASSβ the widget finds the first shell in the widget hierarchy that has aWM_CLASSproperty and transfers the contents as text in the current locale.CLIENT_WINDOWβ the widget finds the first shell in the widget hierarchy and transfers its window as typeWINDOW.COLORMAPβ the widget transfersXmNcolormapas typeCOLORMAP.FOREGROUNDβ the widget transfersXmNforegroundas typePIXEL.NAMEβ the widget finds the first shell in the widget hierarchy that has aWM_NAMEproperty and transfers the contents as text in the current locale.TARGETSβ the widget transfers, as typeATOM, a list of the targets it supports. these include the standard targets in this list. whenXmNlabelTypeisXmSTRINGorXmPIXMAP_AND_STRING, these also include_MOTIF_COMPOUND_STRING,COMPOUND_TEXT,UTF8_STRING, the encoding of the locale,STRING, andTEXT. whenXmNlabelTypeisXmPIXMAPorXmPIXMAP_AND_STRING, these also includePIXMAP.TIMESTAMPβ the widget transfers the timestamp used to acquire the selection as typeINTEGER._MOTIF_RENDER_TABLEβ the widget transfersXmNrenderTableif it exists, or else the default text render table, as typeSTRING._MOTIF_ENCODING_REGISTRYβ the widget transfers its encoding registry as typeSTRING. the value is a list of NULL separated items in the form of tag encoding pairs. this target symbolizes the transfer target for the Motif Segment Encoding Registry. widgets and applications can use this Registry to register text encoding formats for specified render table tags. applications access this Registry by callingXmRegisterSegmentEncodingandXmMapSegmentEncoding.
π§ Classes π§
Label inherits behavior, resources, and traits from Core and XmPrimitive. the family tree is giving old money π«Ά
- the class pointer is
xmLabelWidgetClass. - the class name is
XmLabel.
π 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).
keep those four codes memorized, bestie βC,S,G,N/Aβ because they're about to show up on literally every single row π
okay so before we get into the actual resource tea, here's the whole XmLabel resource set laid out like a little menu of vibes π«Ά every single one of these is class CSG (that's the access column bestie, it means you can set 'em at creation, set 'em with XtSetValues, and get 'em with XtGetValues β the full trifecta β¨). here's every resource with its class, type and default, no skips, no skips ever:
XmNacceleratorβ classXmCAccelerator, typeString, defaultNULLXmNacceleratorTextβ classXmCAcceleratorText, typeXmString, defaultNULLXmNalignmentβ classXmCAlignment, typeunsigned char, default dynamicXmNfontListβ classXmCFontList, typeXmFontList, default dynamicXmNlabelInsensitivePixmapβ classXmCLabelInsensitivePixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAPXmNlabelPixmapβ classXmCLabelPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAPXmNlabelStringβ classXmCXmString, typeXmString, default dynamicXmNlabelTypeβ classXmCLabelType, typeunsigned char, defaultXmSTRINGXmNmarginBottomβ classXmCMarginBottom, typeDimension, default0XmNmarginHeightβ classXmCMarginHeight, typeDimension, default2XmNmarginLeftβ classXmCMarginLeft, typeDimension, default0XmNmarginRightβ classXmCMarginRight, typeDimension, default0XmNmarginTopβ classXmCMarginTop, typeDimension, default0XmNmarginWidthβ classXmCMarginWidth, typeDimension, default2XmNmnemonicβ classXmCMnemonic, typeKeySym, defaultNULLXmNmnemonicCharSetβ classXmCMnemonicCharSet, typeString, defaultXmFONTLIST_DEFAULT_TAGXmNpixmapPlacementβ classXmCPixmapPlacement, typeunsigned int, defaultXmPIXMAP_LEFTXmNpixmapTextPaddingβ classXmCSpace, typeDimension, default2XmNrecomputeSizeβ classXmCRecomputeSize, typeBoolean, defaultTrueXmNrenderTableβ classXmCRenderTable, typeXmRenderTable, default dynamicXmNstringDirectionβ classXmCStringDirection, typeXmStringDirection, default dynamic
XmNaccelerator πΉ
okay bestie, this one is giving keyboard shortcuts that actually slap. it sets the accelerator on a button widget in a menu β and what that means is: it lets you activate a button from the keyboard. the button can be visible, it can be invisible, but it has to be managed, no exceptions. if it's not managed, don't even try it π
this resource is a String, and that string is a whole little description of a set of modifiers plus the key you can use to select that button.
and here's the part where you gotta pay attention, because the format is identical to the one the translations manager uses β with two lil' twists:
- only a single event may be specified, just one, one singular event, that's it
- only
KeyPressevents are allowed. that's the only flavor on the menu β¨
also, real talk: accelerators for buttons are supported only forPushButtonsandToggleButtonsinPulldownandPopupmenu panes. that's the whole guest list. periodt π
XmNacceleratorTextβ the text that gets shown for the accelerator β¨ It shows up right next to the label string or pixmap, and the direction it lays itself out depends on the widget'sXmNlayoutDirectionresource. Heads up tho: for buttons, accelerator text only displays for PushButtons and ToggleButtons inside Pulldown and Popup Menus.XmNalignmentβ where the label (text or pixmap) lines up π―XmALIGNMENT_BEGINNING(left alignment) β lines up the left sides of the text lines vertically with the left edge of the widget window. For a pixmap, its left side is vertically aligned with the left edge of the widget window.XmALIGNMENT_CENTER(center alignment) β lines up the centers of the text lines vertically in the center of the widget window. For a pixmap, its center is vertically aligned with the center of the widget window.XmALIGNMENT_END(right alignment) β lines up the right sides of the text lines vertically with the right edge of the widget window. For a pixmap, its right side is vertically aligned with the right edge of the widget window.
okay bestie, plot twist: all those text descriptions above are true when XmNlayoutDirection is XmLEFT_TO_RIGHT. When that resource is XmRIGHT_TO_LEFT, the descriptions for XmALIGNMENT_BEGINNING and XmALIGNMENT_END get switched. iykyk π
And if the parent is a RowColumn whose XmNisAligned resource is True, then XmNalignment gets forced to the same value as the RowColumn's XmNentryAlignment β but only if the RowColumn's XmNrowColumnType is XmWORK_AREA or the widget is a subclass of XmLabel. Otherwise, the default is XmALIGNMENT_CENTER. periodt π
XmNfontListβ the font used for the widget's text ποΈ
ngl this one is obsolete β it only exists for compatibility with previous releases. You should be using XmNrenderTable instead of XmNfontList now. If both are specified, the render table takes precedence, no contest.
If XmNfontList is NULL at initialization, Label goes on a little quest up its parent hierarchy looking for an ancestor that is a subclass of the XmBulletinBoard, VendorShell, or XmMenuShell widget class. If it finds one, Label initializes XmNfontList to the XmNlabelFontList of that ancestor widget. Same energy for button subclasses of Label: they initialize XmNfontList to the XmNbuttonFontList of the ancestor widget. (Currently, all subclasses of Label are button subclasses, just so u know.) If no such ancestor is found, the default is implementation dependent. Peep XmFontList(3) for more on creating and structuring a font list π
XmNlabelInsensitivePixmapβ the pixmap used as the button face whenXmNlabelTypeisXmPIXMAPand the button is insensitive. The default value,XmUNSPECIFIED_PIXMAP, shows an empty label. ghost mode π»XmNlabelPixmapβ the pixmap whenXmNlabelTypeisXmPIXMAPorXmPIXMAP_AND_STRING. The default value,XmUNSPECIFIED_PIXMAP, shows an empty label πΌοΈXmNlabelStringβ the compound string whenXmNlabelTypeisXmSTRINGorXmPIXMAP_AND_STRING. If this value isNULL, it gets initialized by converting the name of the widget to a compound string. PeepXmString(3)for more on creating and structuring compound strings β¨XmNlabelTypeβ the label type, bestie:XmSTRINGβ displays text usingXmNlabelString.XmPIXMAPβ displays pixmap usingXmNlabelPixmaporXmPIXMAP_AND_STRINGβ displays text and pixmap usingXmNlabelPixmaporXmNlabelInsensitivePixmapandXmNlabelString.
XmNmarginBottomβ the amount of spacing between the bottom of the label text and the top of the bottom margin specified byXmNmarginHeight. Label's subclasses may modify this. For example,CascadeButtonmay increase this field to make room for the cascade pixmap πXmNmarginHeightβ an equal amount of spacing above the margin defined byXmNmarginTopand below the margin defined byXmNmarginBottom. It specifies the amount of spacing between the top edge of the margin set byXmNmarginTopand the bottom edge of the top shadow, plus the amount of spacing between the bottom edge of the margin specified byXmNmarginBottomand the top edge of the bottom shadow πΈXmNmarginLeftβ the amount of spacing between the left edge of the label text and the right side of the left margin (specified byXmNmarginWidth). Label's subclasses may modify this. For example,ToggleButtonmay increase this field to make room for the toggle indicator and for spacing between the indicator and label. Whether this actually applies to the left or right side of the label depends on the value of theXmNlayoutDirectionresource πXmNmarginRightβ the amount of spacing between the right edge of the label text and the left side of the right margin (specified byXmNmarginWidth). Label's subclasses may modify this. For example,CascadeButtonmay increase this field to make room for the cascade pixmap. Whether this actually applies to the left or right side of the label depends on the value of theXmNlayoutDirectionresource πXmNmarginTopβ the amount of spacing between the top of the label text and the bottom of the top margin specified byXmNmarginHeight. Label's subclasses may modify this. For example,CascadeButtonmay increase this field to make room for the cascade pixmap πXmNmarginWidthβ an equal amount of spacing to the left of the margin defined byXmNmarginLeftand to the right of the margin defined byXmNmarginRight. It specifies the amount of spacing between the left edge of the margin set byXmNmarginLeftand the right edge of the left shadow, plus the amount of spacing between the right edge of the margin specified byXmNmarginRightand the left edge of the right shadow πXmNmnemonicβ gives the user an alternate means of activating a button π A button in a MenuBar, a Popup menu pane, or a Pulldown menu pane can have a mnemonic.
This resource holds a keysym as listed in the X11 keysym table. The first character in the label string that exactly matches the mnemonic in the character set specified in XmNmnemonicCharSet gets underlined when the button is displayed.
When a mnemonic has been specified, the user activates the button by pressing the mnemonic key while the button is visible. If the button is a CascadeButton in a MenuBar and the MenuBar does not have the focus, the user has to use the MAlt modifier while pressing the mnemonic. The user can activate the button by pressing either the shifted or the unshifted mnemonic key π
XmNmnemonicCharSetβ the character set of the mnemonic for the label. The default isXmFONTLIST_DEFAULT_TAGπXmNpixmapPlacementβ where the pixmap sits with respect to the text label π This resource can take one of these values:XmPIXMAP_TOP,XmPIXMAP_BOTTOM,XmPIXMAP_LEFT, andXmPIXMAP_RIGHT. A type converter has been registered that converts the following strings:"top","bottom","left", and"right".XmNpixmapTextPaddingβ the amount of space to be left between the pixmap and the label string π«ΆXmNrecomputeSizeβ a Boolean value that says whether the widget shrinks or expands to accommodate its contents (label string or pixmap) as a result of anXtSetValuesresource value that would change the size of the widget. IfTrue, the widget shrinks or expands to exactly fit the label string or pixmap. IfFalse, the widget never attempts to change size on its own. main character stays her size πXmNrenderTableβ the render table associated with thelabelString. If this value isNULLat initialization, Label searches its parent hierarchy for an ancestor that holds theXmQTspecifyRenderTabletrait. If such an ancestor is found, Label initializesXmNrenderTableto theXmLABEL_RENDER_TABLEvalue of the ancestor widget. Similarly, button subclasses of Label initializeXmNrenderTableto theXmBUTTON_RENDER_TABLEvalue of the ancestor widget. (Note that all current subclasses of Label are button subclasses.) If no such ancestor is found, the default is implementation dependent. If a font list and a render table are both specified, the render table will take precedence. PeepXmRenderTable(3)for more on creating and structuring a render table β¨XmNstringDirectionβ a synthetic resource for settingXmNlayoutDirection. The values for this resource areXmSTRING_DIRECTION_L_TO_RandXmSTRING_DIRECTION_R_TO_L. Refer to theXmNlayoutDirectionresource description. TheXmNstringDirectionresource is obsoleted byXmNlayoutDirection, but it's kept here for backward compatibility π
π¦ Inherited Resources π¦
Label inherits behavior and resources from the following superclasses. For a complete description of each resource, refer to the reference page for that superclass. no cap, go read them π
okay bestie, now we're getting into the XmPrimitive resource set β this is the whole glow-up list, every single one of them, no skipping, no cap π
β¨
Each one's got its Name, its Class, its Type, its Default, and its Access code, and I'm giving you all five for every single one because we do not gatekeep here π«Ά
XmNbottomShadowColorβ classXmCBottomShadowColor, typePixel, default is dynamic, accessCSG. that bottom shadow color? she's dynamic, she moves with the vibe πXmNbottomShadowPixmapβ classXmCBottomShadowPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG. literally unspecified until you say otherwise πXmNconvertCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. a whole callback list, and by default it's just sitting there empty,NULL, iconic πXmNforegroundβ classXmCForeground, typePixel, default dynamic, accessCSG. the main character of colors, fr fr πXmNhelpCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. help me help you, but only if you set it β default isNULLbestie πXmNhighlightColorβ classXmCHighlightColor, typePixel, default dynamic, accessCSG. highlight moment, dynamic by default, obsessed βXmNhighlightOnEnterβ classXmCHighlightOnEnter, typeBoolean, defaultFalse, accessCSG. does it highlight when you enter? default saysFalse, so no, not unless you ask nicely πXmNhighlightPixmapβ classXmCHighlightPixmap, typePixmap, default dynamic, accessCSG. the pixmap version of the highlight, also dynamic, she's flexible like that π¦XmNhighlightThicknessβ classXmCHighlightThickness, typeDimension, default0, accessCSG. zero thickness by default, so like... no highlight thickness at all. we love a minimalist πΈXmNlayoutDirectionβ classXmCLayoutDirection, typeXmDirection, default dynamic, accessCG. note the access here isCG, notCSGβ you can't set this one at create time, only get it. important detail, don't sleep on it β¨XmNnavigationTypeβ classXmCNavigationType, typeXmNavigationType, defaultXmNONE, accessCSG. default isXmNONE, so no navigation type until you pick one π§XmNpopupHandlerCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. another callback list, anotherNULLdefault, we stay consistent πXmNshadowThicknessβ classXmCShadowThickness, typeDimension, default0, accessCSG. zero shadow thickness, flat era by default π₯XmNtopShadowColorβ classXmCTopShadowColor, typePixel, default dynamic, accessCSG. top shadow color, dynamic, matching her bottom-shadow sister πXmNtopShadowPixmapβ classXmCTopShadowPixmap, typePixmap, default dynamic, accessCSG. and here she's dynamic β unlike the bottom one which wasXmUNSPECIFIED_PIXMAP. yes bestie, they're different, read it again πXmNtraversalOnβ classXmCTraversalOn, typeBoolean, defaultFalse, accessCSG. traversal? off by default.False. periodt πXmNunitTypeβ classXmCUnitType, typeunsigned char, default dynamic, accessCSG. yes, the type really isunsigned char, that's not a typo, that's the lore πXmNuserDataβ classXmCUserData, typeXtPointer, defaultNULL, accessCSG. your little pocket of user data,NULLuntil you claim it π
so that's the full XmPrimitive lineup β eighteen of them, every field intact, nothing dropped, nothing invented π and bestie, notice how many of these default to dynamic versus how many are just sitting at 0, False, or NULL? that's the whole personality of the widget right there π
more coming, don't go anywhere π«Ά
π Core Resource Set π
okay bestie, here's the whole core resource lineup β every name, class, type, default and access code, all of it, no skips π
XmNacceleratorsβ classXmCAccelerators, typeXtAccelerators, default dynamic, accessCSGXmNancestorSensitiveβ classXmCSensitive, typeBoolean, default dynamic, accessGXmNbackgroundβ classXmCBackground, typePixel, default dynamic, accessCSGXmNbackgroundPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNborderColorβ classXmCBorderColor, typePixel, defaultXtDefaultForeground, accessCSGXmNborderPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNborderWidthβ classXmCBorderWidth, typeDimension, default0, accessCSGXmNcolormapβ classXmCColormap, typeColormap, default dynamic, accessCGXmNdepthβ classXmCDepth, typeint, default dynamic, accessCGXmNdestroyCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNheightβ classXmCHeight, typeDimension, default dynamic, accessCSGXmNinitialResourcesPersistentβ classXmCInitialResourcesPersistent, typeBoolean, defaultTrue, accessCXmNmappedWhenManagedβ classXmCMappedWhenManaged, typeBoolean, defaultTrue, accessCSGXmNscreenβ classXmCScreen, typeScreen *, default dynamic, accessCGXmNsensitiveβ classXmCSensitive, typeBoolean, defaultTrue, accessCSGXmNtranslationsβ classXmCTranslations, typeXtTranslations, default dynamic, accessCSGXmNwidthβ classXmCWidth, typeDimension, default dynamic, accessCSGXmNxβ classXmCPosition, typePosition, default0, accessCSGXmNyβ classXmCPosition, typePosition, default0, accessCSG
πΈ Translations πΈ
so XmLabel lowkey inherits translations from Primitive β it's giving nepo baby but make it useful π Here's the list:
the key names below are written in the X standard key event translation table syntax, which is the format Motif uses to say which widget actions fire for a given key. There's a quick lil overview of the format over in VirtualBindings(3) β and if you want the full deep dive, bestie, go read the X Toolkit Instrinsics Documentation. π
<Btn2Down>:
ProcessDrag()
:<Key><osfHelp>:
Help()
and the translations that subclasses of XmLabel use for menu traversal? yeah, those are here too π§
:<Key><osfCancel>:
MenuEscape()
:<Key><osfLeft>:
MenuTraverseLeft()
:<Key><osfRight>:
MenuTraverseRight()
:<Key><osfUp>:
MenuTraverseUp()
:<Key><osfDown>:
MenuTraverseDown()
β¨ Action Routines β¨
The XmLabel action routines are
Help()</p> π
So if you're chillin' in a Popup or a Pulldown MenuPane, this one unposts every menu in the whole menu hierarchy β like, all of them, gone π¨ β and when the shell's keyboard focus policy is XmEXPLICIT, it restores keyboard focus to the widget that had the focus before the menu system was even entered. It also calls the callbacks for XmNhelpCallback if any exist. And bestie, if this widget has no help callbacks? It goes and calls the help callbacks for the nearest ancestor that has them. Passing the vibe up the family tree π
MenuEscape()</p> πͺ
- In a MenuBar: 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 top-level Pulldown MenuPane from a MenuBar: 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: unposts the menu and moves the focus to its CascadeButton. - In a Popup MenuPane: 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.
MenuTraverseDown()</p> β¬οΈ
If the current menu item has a submenu and it's in a MenuBar, this action posts the submenu, disarms the current menu item, and arms the submenu's first traversable menu item. Opening a whole new world β¨
If the current menu item is in a MenuPane, this action disarms the current menu item and arms the item below it. It wraps within the MenuPane, and the direction of the wrapping depends on the XmNlayoutDirection resource. iykyk π
MenuTraverseLeft()</p> β¬
οΈ
Okay this one is a whole saga, buckle up π
When the current menu item is in a MenuBar, this action disarms the current item and arms the MenuBar item to the left. It wraps within the MenuBar.
In MenuPanes: if the current menu item is not at the left edge of a MenuPane, this action disarms the current item and arms the item to its left. If the current menu item is at the left edge of a submenu attached to a MenuBar item, this action unposts the submenu and traverses to the MenuBar item to the left, wrapping if necessary. If that MenuBar item has a submenu, it posts the submenu and arms the first traversable item in the submenu. And if the current menu item is at the left edge of a submenu not directly attached to a MenuBar item, this action unposts the current submenu only.
In Popup or Torn-off MenuPanes, when the current menu item is at the left edge, this action wraps within the MenuPane. If the current menu item is at the left edge of the MenuPane and not in the top row, this action wraps to the rightmost menu item in the row above. If the current menu item is in the upper, leftmost corner, this action wraps to the tear-off control, if present, or else it wraps to the bottom, rightmost menu item in the MenuPane.
The preceding description applies when theXmNlayoutDirectionhorizontal direction isXmLEFT_TO_RIGHT. If theXmNlayoutDirectionhorizontal direction isXmRIGHT_TO_LEFT, then the following applies. π
If the current menu item is in a MenuBar, then this action disarms the current item and arms the MenuBar item to the left. This action wraps within the MenuBar.
In MenuPanes, if the current menu item is a CascadeButton, then this action posts its associated submenu. If the current menu item is not a CascadeButton and is not at the left edge of a MenuPane, this action disarms the current item and arms the item to its left, wrapping if necessary. If the current menu item is not a CascadeButton and is at the left edge of a submenu that is a descendent of a MenuBar, then this action unposts all submenus and traverses to the MenuBar item to the left. If that MenuBar item has a submenu, it posts the submenu and arms the submenu's first traversable item.
In Popup or Torn-off menus, if the current menu item is not a CascadeButton and is at the left edge of a row (except the bottom row), this action wraps to the rightmost menu item in the row below. If the current menu item is not a CascadeButton and is in the bottom, leftmost corner of a Popup or Pulldown MenuPane, this action wraps to the tear-off control, if present, or else it wraps to the top, rightmost menu item of the MenuPane.
MenuTraverseRight()</p> β‘οΈ
If the current menu item is in a MenuBar, then this action disarms the current item and arms the MenuBar item to the right. This action wraps within the MenuBar.
In MenuPanes, if the current menu item is a CascadeButton, then this action posts its associated submenu. If the current menu item is not a CascadeButton and is not at the right edge of a MenuPane, this action disarms the current item and arms the item to its right, wrapping if necessary. If the current menu item is not a CascadeButton and is at the right edge of a submenu that is a descendent of a MenuBar, then this action unposts all submenus and traverses to the MenuBar item to the right. If that MenuBar item has a submenu, it posts the submenu and arms the submenu's first traversable item.
In Popup or Torn-off menus, if the current menu item is not a CascadeButton and is at the right edge of a row (except the bottom row), this action wraps to the leftmost menu item in the row below. If the current menu item is not a CascadeButton and is in the bottom, rightmost corner of a Popup or Pulldown MenuPane, this action wraps to the tear-off control, if present, or else it wraps to the top, leftmost menu item of the MenuPane.
The preceding description applies when theXmNlayoutDirectionhorizontal direction isXmLEFT_TO_RIGHT. If theXmNlayoutDirectionhorizontal direction isXmRIGHT_TO_LEFT, then the following applies. π
When the current menu item is in a MenuBar, then this action disarms the current item and arms the MenuBar item to the left. This action wraps within the MenuBar.
In MenuPanes, if the current menu item is not at the right edge of a MenuPane, this action disarms the current item and arms the item to its right. If the current menu item is at the right edge of a submenu attached to a MenuBar item, then this action unposts the submenu and traverses to the MenuBar item to the right, wrapping if necessary. If that MenuBar item has a submenu, it posts the submenu and arms the first traversable item in the submenu. And if the current menu item is at the right edge of a submenu not directly attached to a MenuBar item, then this action unposts the current submenu only.
In Popup or Torn-off MenuPanes, when the current menu item is at the right edge, this action wraps within the MenuPane. If the current menu item is at the right edge of the MenuPane and not in the top row, this action wraps to the leftmost menu item in the row above. If the current menu item is in the upper, rightmost corner, this action wraps to the tear-off control, if present, or else it wraps to the bottom, leftmost menu item in the MenuPane.
MenuTraverseUp()</p> β¬οΈ
When the current menu item is in a MenuPane, then this action disarms the current menu item and arms the item above it. This action wraps within the MenuPane. The direction of the wrapping depends on the XmNlayoutDirection resource. Simple, clean, iconic π
ProcessDrag()</p> ποΈ
Drags the contents of a Label, identified when BTransfer is pressed. This action sets the XmNconvertProc of the DragContext to a function that calls the XmNconvertCallback procedures β possibly multiple times β for the _MOTIF_DROP selection.
Heads up bestie: this action is undefined for Labels used in a menu system. π« Do not try it. It will not slay, it will just be undefined.
π¦ Virtual Bindings π¦
The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see VirtualBindings(3). (Yes queen, go read that one, it's the plug π)
π RELATED π
Core(3), XmCreateLabel(3), XmFontListAppendEntry(3), XmStringCreate(3), XmStringCreateLtoR(3), XmPrimitive(3), XmVaCreateLabel(3), and XmVaCreateManagedLabel(3). The whole friend group π«Ά go say hi.
And that's a wrap on the XmLabel(library call) page β this is the library-call flavour of the man page, straight from the XmLabel source, no cap. Thanks for reading all six parts, bestie, you ate that π
β¨
π¦ where this page comes from
- 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