XMSELECTIONBOX(3)

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

πŸ‘‘ XmSelectionBox β€” the SelectionBox widget class πŸ‘‘

okay bestie, welcome to XmSelectionBox from the library call crew πŸ’– this is the widget class that's about to become your whole personality, so sit down, hydrate, and let's get into it.


✨ NAME ✨

XmSelectionBox β€” the SelectionBox widget class. that's it, that's the name, iconic behavior πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <Xm/SelectioB.h>

(and yes bestie, that spelling of the header is exactly right β€” SelectioB.h, no n, don't @ me, that's just how it is πŸ’…)


🌸 DESCRIPTION 🌸

SelectionBox is a general dialog widget that lets the user select one item from a list. a whole queen who does one thing and does it flawlessly, no cap.

By default, a SelectionBox comes with all of this, pre-glowup'd:

  • a scrolling list of alternatives πŸ“
  • an editable text field for the selected alternative ✏️
  • labels for the list and the text field 🏷️
  • three or four buttons 🫢

The default button labels are OK, Cancel, and Help. By default an Apply button is also created; if the parent of the SelectionBox is a DialogShell, it is managed; otherwise it is unmanaged. (so like… it exists, it's just not showing up to the party yet πŸ™ˆ)

Additional children may be added to the SelectionBox after creation. The first child is used as a work area. The value of XmNchildPlacement decides if the work area gets placed above or below the Text area, or above or below the List area. Any additional children beyond that get laid out like this:

  • Menubar β€” the first menu bar child is placed at the top of the window. The XmQTmenuSystem trait is used to check that it's actually the first MenuBar child.
  • Buttons β€” all XmPushButton widgets or gadgets, and their subclasses, are placed after the OK button in the order of their creation (this order is checked using the XmQTactivatable trait). The layout direction of the buttons depends on the XmNlayoutDirection resource.
The layout of additional children that are not in the above categories is undefined. so like, don't count on it, bestie πŸ’€

The user can select an item in two ways: by scrolling through the list and selecting the desired item, or by entering the item name directly into the text edit area. Selecting an item from the list causes that item name to appear in the selection text edit area. ✨ auto-fill energy ✨

The user may select a new item as many times as they want, no limits, we don't gatekeep. The item is not actually selected until the user presses the OK PushButton. like… commitment issues, but make it a dialog.

The default value for the XmBulletinBoard resource XmNcancelButton is the Cancel button β€” unless XmNdialogType is XmDIALOG_COMMAND, in which case the default is NULL. The default value for the XmBulletinBoard XmNdefaultButton resource is the OK button β€” unless XmNdialogType is XmDIALOG_COMMAND, in which case the default is NULL.

For SelectionBox and its subclasses, the default value for XmNinitialFocus is the text edit area. πŸ‘‘

The user can specify resources in a resource file for the automatically created widgets and gadgets of SelectionBox. Here's the list of names and which SelectionBox area each one maps to:

  • List Items Label β€” Items
  • List Items β€” ItemsList
  • Selection Label β€” Selection
  • Selection Text β€” Text or TextField
  • Selection Separator β€” Separator

SelectionBox uses the XmQTaccessTextual, XmQTactivatable, and XmQTmenuSystem traits. trait girlie 🧚


πŸŽ€ Descendants πŸŽ€

SelectionBox automatically creates the descendants listed below. 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.

(the original ships this as a whole table β€” here it is, unfolded, every single row, nothing dropped πŸ’œ)

  • Apply β€” class XmPushButtonGadget β€” Apply button
  • Cancel β€” class XmPushButtonGadget β€” Cancel button
  • Help β€” class XmPushButtonGadget β€” Help button
  • Items β€” class XmLabelGadget β€” title above the list of items
  • ItemsList β€” class XmList β€” list of items from which the user will select
  • ItemsListSW β€” class XmScrolledWindow β€” ScrolledWindow parent of ItemsList
  • OK β€” class XmPushButtonGadget β€” OK button
  • Selection β€” class XmLabelGadget β€” title above the selection box
  • Separator β€” class XmSeparatorGadget β€” dividing line between selection box and buttons
  • Text β€” class XmTextField β€” selection box containing text of selected item

🌈 Classes 🌈

SelectionBox inherits behavior, resources, and traits from Core, Composite, Constraint, XmManager, and XmBulletinBoard. it's giving generational wealth, fr fr πŸ’…

The class pointer is xmSelectionBoxWidgetClass.

The class name is XmSelectionBox.


⭐ 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).

and that's where part 1 leaves us, bestie β€” the resource table itself is coming up next, so don't go anywhere 🫢✨

πŸ’– XmSelectionBox Resource Set πŸ’–

okay bestie, here's the full resource menu for XmSelectionBox β€” every single one, no skips, no "etc." πŸ™…β€β™€οΈ the format is name Β· class Β· type Β· default Β· access code, so you always know what you're setting and where it comes from πŸ’…

  • XmNapplyCallback Β· class XmCCallback Β· type XtCallbackList Β· default NULL Β· access C
  • XmNapplyLabelString Β· class XmCApplyLabelString Β· type XmString Β· default dynamic Β· access CSG
  • XmNcancelCallback Β· class XmCCallback Β· type XtCallbackList Β· default NULL Β· access C
  • XmNcancelLabelString Β· class XmCCancelLabelString Β· type XmString Β· default dynamic Β· access CSG
  • XmNchildPlacement Β· class XmCChildPlacement Β· type unsigned char Β· default XmPLACE_ABOVE_SELECTION Β· access CSG
  • XmNdialogType Β· class XmCDialogType Β· type unsigned char Β· default dynamic Β· access CG
  • XmNhelpLabelString Β· class XmCHelpLabelString Β· type XmString Β· default dynamic Β· access CSG
  • XmNlistItemCount Β· class XmCItemCount Β· type int Β· default 0 Β· access CSG
  • XmNlistItems Β· class XmCItems Β· type XmStringTable Β· default NULL Β· access CSG
  • XmNlistLabelString Β· class XmCListLabelString Β· type XmString Β· default dynamic Β· access CSG
  • XmNlistVisibleItemCount Β· class XmCVisibleItemCount Β· type int Β· default dynamic Β· access CSG
  • XmNminimizeButtons Β· class XmCMinimizeButtons Β· type Boolean Β· default False Β· access CSG
  • XmNmustMatch Β· class XmCMustMatch Β· type Boolean Β· default False Β· access CSG
  • XmNnoMatchCallback Β· class XmCCallback Β· type XtCallbackList Β· default NULL Β· access C
  • XmNokCallback Β· class XmCCallback Β· type XtCallbackList Β· default NULL Β· access C
  • XmNokLabelString Β· class XmCOkLabelString Β· type XmString Β· default dynamic Β· access CSG
  • XmNselectionLabelString Β· class XmCSelectionLabelString Β· type XmString Β· default dynamic Β· access CSG
  • XmNtextAccelerators Β· class XmCTextAccelerators Β· type XtAccelerators Β· default default Β· access C
  • XmNtextColumns Β· class XmCColumns Β· type short Β· default dynamic Β· access CSG
  • XmNtextString Β· class XmCTextString Β· type XmString Β· default "" Β· access CSG

✨ the actual explanations, resource by resource ✨

πŸ’– XmNapplyCallback

This is the list of callbacks that get called when the user activates the Apply button. The callback reason is XmCR_APPLY. πŸŽ€

πŸ’– XmNapplyLabelString

This one is the string label for the Apply button. What the default is depends on your locale β€” in the C locale the default is Apply. 🌸

Now listen, this next bit matters: 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. That's the whole vibe β€” parent level or nothing, bestie. 🫢

πŸ’– XmNcancelCallback

The list of callbacks called when the user activates the Cancel button. The callback reason is XmCR_CANCEL. πŸ‘‘

πŸ’– XmNcancelLabelString

The string label for the Cancel button. Locale-dependent default again β€” in the C locale the default is Cancel. 🌈

And same deal as the Apply label, no cap: 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. πŸ’…

πŸ’– XmNchildPlacement

This one specifies the placement of the work area child. The possible values are

  • XmPLACE_ABOVE_SELECTION β€” places the work area child above the Text area
  • XmPLACE_BELOW_SELECTION β€” puts the work area child below the Text area, slay πŸ’…
  • XmPLACE_TOP β€” puts the work area child above the List area, and below a MenuBar if one is even in the building πŸ‘‘

  • XmNdialogType β€” okay so this one decides exactly which SelectionBox children get created and managed at initialization πŸŽ€. The possible values are:
    • XmDIALOG_PROMPT β€” every standard child gets created except the list and the list label, and everything except the Apply button gets managed πŸ’–
    • XmDIALOG_COMMAND β€” only the list, the selection label, and the text field get created and managed 🫢
    • XmDIALOG_SELECTION β€” all standard children get created and managed ✨
    • XmDIALOG_FILE_SELECTION β€” all standard children get created and managed (yes, literally the same energy, not a typo) 🌸
    • XmDIALOG_WORK_AREA β€” all standard children get created, and all of them except the Apply button get managed πŸ¦‹

If the parent of the SelectionBox is a DialogShell, the default is XmDIALOG_SELECTION; if it's not, the default is XmDIALOG_WORK_AREA. XmCreatePromptDialog and XmCreateSelectionDialog set this resource and append it to the creation arglist your application supplies. And bestie, listen β€” this resource cannot be modified after creation, so choose wisely at the door πŸšͺ

  • XmNhelpLabelString β€” the string label for the Help button πŸ†˜. What the default actually is depends on your locale; in the C locale it's Help.
Fr fr, heads up: now that some default localized label strings come through message catalogs for the children of composite widgets, you can't set the labelString resources on the child through default resource files anymore. You have to use the resource that's provided at the parent level instead 🫢
  • XmNlistItems β€” the items chillin' in the SelectionBox list πŸ“‹. Careful though: XtGetValues on this resource hands you back the list items themselves, not a copy of them. So the application must not free the returned items, periodt πŸ™…β€β™€οΈ
  • XmNlistItemCount β€” how many items are in the SelectionBox list πŸ”’. The value must not be negative, bestie, that's not a vibe.
  • XmNlistLabelString β€” the string label that sits above the SelectionBox list holding the selection items 🏷️. Default depends on locale; in the C locale it's Items, unless XmNdialogType is XmDIALOG_PROMPT β€” in that case the default is NULL.
Same PSA again, because it keeps coming up: since some default localized label strings are now delivered through message catalogs for the children of composite widgets, the labelString resources can't be set on the child through default resource files. Use the resource at the parent level instead πŸ’œ
  • XmNlistVisibleItemCount β€” how many items actually show up in the SelectionBox list πŸ‘€. The value has to be greater than 0 (zero) unless XmNdialogType is XmDIALOG_PROMPT; in that case the value is always 0. The default is dynamic, based on how tall the list is.
  • XmNminimizeButtons β€” if it's False, the buttons get set to the width of the widest button and the height of the tallest button. If it's True, button width and height don't get modified at all πŸ’…
  • XmNmustMatch β€” tells you whether the selection widget should check that what the user typed into the text edit field has an exact match somewhere in the SelectionBox list when the OK button gets activated πŸ”. No exact match + XmNmustMatch is True = the XmNnoMatchCallback callbacks fire. Exact match found, or XmNmustMatch is False = the XmNokCallback callbacks fire instead.
  • XmNnoMatchCallback β€” the list of callbacks that get called when the user makes a selection from the text edit field that doesn't exactly match any of the items in the list box 😭. The callback reason is XmCR_NO_MATCH. And these only ever fire if XmNmustMatch is true.
  • XmNokCallback β€” the list of callbacks that get called when the user activates the OK button βœ…. The callback reason is XmCR_OK. But if the selection text doesn't match a list item and XmNmustMatch is True, then the XmNnoMatchCallback callbacks get called instead.
  • XmNokLabelString β€” the string label for the OK button πŸ‘‘. Locale-dependent default; in the C locale it's OK.
And one more time for the people in the back: now that some default localized label strings are provided through message catalogs for the children of composite widgets, labelString resources cannot be set on the child through default resource files. The resource provided at the parent level is what you use πŸ’–
  • XmNselectionLabelString β€” the string label for the selection text edit field ✍️. Default depends on locale; in the C locale it's Selection.
Yep, same rule applies here too: because some default localized label strings come through message catalogs for the children of composite widgets, the labelString resources can't be set on the child through default resource files. Go through the resource provided at the parent level 🌈
  • XmNtextAccelerators β€” the translations added to the Text widget child of the SelectionBox ⌨️. The default includes bindings for the up and down keys, for auto selection of list items ✨. This resource gets ignored if XmNaccelerators is initialized to a nondefault value.
  • XmNtextColumns β€” how many columns the Text widget has πŸ“. The value must be greater than 0 (zero).
  • XmNtextString β€” the text sitting in the text edit selection field πŸ“.

🌈 Inherited Resources 🌈

SelectionBox inherits behavior and resources from its superclasses, and they're all laid out in the tables that follow πŸ“Š. For a full, complete description of each one of those resources, go read the reference page for that superclass β€” iykyk πŸ’œ

✨ XmBulletinBoard Resource Set ✨

okay bestie, here's the whole XmBulletinBoard resource set β€” every single row, every single column, no skips. The columns are Name, Class, Type, Default, and Access. let's go πŸ’…

  • XmNallowOverlap β€” class XmCAllowOverlap, type Boolean, default True, access CSG. overlap said yes, periodt.
  • XmNautoUnmanage β€” class XmCAutoUnmanage, type Boolean, default True, access CG. auto-unmanage is true, iconic πŸ’–
  • XmNbuttonFontList β€” class XmCButtonFontList, type XmFontList, default dynamic, access CSG. font list but make it button πŸ’…
  • XmNbuttonRenderTable β€” class XmCButtonRenderTable, type XmRenderTable, default dynamic, access CSG. render table for buttons, slay ✨
  • XmNcancelButton β€” class XmCWidget, type Widget, default dynamic, access SG. cancel button widget, so cute πŸŽ€
  • XmNdefaultButton β€” class XmCWidget, type Widget, default dynamic, access SG. default button widget, main character energy πŸ‘‘
  • XmNdefaultPosition β€” class XmCDefaultPosition, type Boolean, default True, access CSG. default position true, no cap
  • XmNdialogStyle β€” class XmCDialogStyle, type unsigned char, default dynamic, access CSG. dialog style, unsigned char vibes 🌈
  • XmNdialogTitle β€” class XmCDialogTitle, type XmString, default NULL, access CSG. title string or NULL, flexible queen πŸ’œ
  • XmNfocusCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. focus callback list, NULL default fr fr
  • XmNlabelFontList β€” class XmCLabelFontList, type XmFontList, default dynamic, access CSG. label font list, adorable πŸŽ€
  • XmNlabelRenderTable β€” class XmCLabelRenderTable, type XmRenderTable, default dynamic, access CSG. label render table, obsessed ✨
  • XmNmapCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. map callback, NULL default πŸ’…
  • XmNmarginHeight β€” class XmCMarginHeight, type Dimension, default 10, access CSG. margin height 10, periodt
  • XmNmarginWidth β€” class XmCMarginWidth, type Dimension, default 10, access CSG. margin width 10, twin πŸ’–
  • XmNnoResize β€” class XmCNoResize, type Boolean, default False, access CSG. no resize is false, lowkey wild
  • XmNresizePolicy β€” class XmCResizePolicy, type unsigned char, default XmRESIZE_ANY, access CSG. resize policy set to XmRESIZE_ANY πŸ”₯
  • XmNshadowType β€” class XmCShadowType, type unsigned char, default XmSHADOW_OUT, access CSG. shadow type out, iconic πŸ’…
  • XmNtextFontList β€” class XmCTextFontList, type XmFontList, default dynamic, access CSG. text font list, dynamic default 🌸
  • XmNtextRenderTable β€” class XmCTextRenderTable, type XmRenderTable, default dynamic, access CSG. text render table, dynamic too πŸ¦‹
  • XmNtextTranslations β€” class XmCTranslations, type XtTranslations, default NULL, access C. text translations, NULL default πŸ™ˆ
  • XmNunmapCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. unmap callback, NULL default πŸ’€

and now we're deep in the inherited resource sets, bestie β€” XmManager first, then Composite. every single row is here, no cap, don't skip a one πŸ’…

πŸ’– XmManager Resource Set πŸ’–

okay so this is the whole XmManager lineup. access codes are exactly what they are, don't try to be cute and change them:

  • 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 here's the Composite set β€” tiny but iconic, fr fr:

  • 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

and that's the inherited resource vibe, but we're not done β€” more is coming, so stay with me 🫢

okay so bestie, the Core Resource Set is literally the blueprint of this widget, and I'm about to give you every single resource, no cap πŸ’–

  • 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 πŸ’–

A pointer to the following structure is passed to each callback:

typedef struct
{
        int reason;
        XEvent * event;
        XmString value;
        int length;
} XmSelectionBoxCallbackStruct;
  • reason β€” tells you why the callback got invoked, iykyk
  • event β€” points to the XEvent that triggered the callback
  • value β€” the XmString value the user picked from the SelectionBox list or typed into the SelectionBox text field
  • length β€” the size in bytes of the XmString value. This member is obsolete and exists for compatibility with earlier releases.

🌈 Translations 🌈

XmSelectionBox inherits translations from XmBulletinBoard. slay.


✨ Accelerators ✨

The XmNtextAccelerators are added to the Text descendant of XmSelectionBox. The default accelerators are described in the following list.

The following key names are listed in the X standard key event translation table syntax. This format is the one used by Motif to specify the widget actions corresponding to a given key. A brief overview of the format is provided under VirtualBindings(3). For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation.

  • :<Key><osfUp>: β€” SelectionBoxUpOrDown(Previous)
  • :<Key><osfDown>: β†’ SelectionBoxUpOrDown(Next)
  • :<Key><osfBeginLine>: β†’ SelectionBoxUpOrDown(First)
  • :<Key><osfEndLine>: β†’ SelectionBoxUpOrDown(Last)
  • :<Key><osfRestore>: β†’ SelectionBoxRestore()
  • s c ∼m ∼a <Key>space: β†’ SelectionBoxRestore()

✨ Action Routines ✨

Bestie, these are the action routines that XmSelectionBox ships with. So slay. πŸ’…

  • SelectionBoxUpOrDown(Previous|Next|First|Last) β€” okay so this one's a whole mood, depending on the argument you hand it:
    • call it with Previous, or 0 (zero) for compatibility, and it selects the previous item in the list and replaces the text with that item. ✨
    • call it with Next, or 1 for compatibility, and it selects the next item in the list and replaces the text with that item.
    • call it with First, or 2 for compatibility, and it selects the first item in the list and replaces the text with that item. πŸ₯‡
    • call it with Last, or 3 for compatibility, and it selects the last item in the list and replaces the text with that item. 🏁
  • SelectionBoxRestore() β€” replaces the text value with the list selection. And if no item in the list is selected? It clears the text. Periodt. 🧹

🌈 Additional Behavior 🌈

The SelectionBox widget also has this extra behavior, and it's lowkey iconic:

  • <Key><osfCancel> β€” calls the activate callbacks for the cancel button, but only if it's sensitive. If there's no cancel button and the parent of the SelectionBox is a manager, it passes the event to the parent. 🫢
  • <Key><osfActivate> β€” calls the activate callbacks for the button with the keyboard focus. If no button has the keyboard focus, it calls the activate callbacks for the default button if it's sensitive.
    • In a List widget or single-line Text widget, the List or Text action associated with <Key><osfActivate> is called before the SelectionBox actions associated with <Key><osfActivate>. πŸ¦‹
    • In a multiline Text widget, any <Key><osfActivate> event except <Key><osfEnter> calls the Text action associated with <Key><osfActivate>, then the SelectionBox actions associated with <Key><osfActivate>.
    • And if no button has the focus, no default button exists, and the parent of the SelectionBox is a manager, it passes the event to the parent. πŸ’œ
  • <OK Button Activated> β€” if XmNmustMatch is True and the text does not match an item in the file list, it calls the XmNnoMatchCallback callbacks with reason XmCR_NO_MATCH. Otherwise, it calls the XmNokCallback callbacks with reason XmCR_OK. No cap. βœ…
  • <Apply Button Activated> β€” calls the XmNapplyCallback callbacks with reason XmCR_APPLY. πŸ’…
  • <Cancel Button Activated> β€” calls the XmNcancelCallback callbacks with reason XmCR_CANCEL. πŸ™ˆ
  • <Help Button Activated> β€” calls the XmNhelpCallback callbacks with reason XmCR_HELP. πŸ†˜
  • <MapWindow> β€” calls the callbacks for XmNmapCallback if the SelectionBox is a child of a Dialog shell. πŸ—ΊοΈ
  • <UnmapWindow> β€” calls the callbacks for XmNunmapCallback if the SelectionBox is the child of a DialogShell. 🌫️

πŸŽ€ Virtual Bindings πŸŽ€

The bindings for virtual keys are vendor specific, bestie β€” so don't come for me if yours hit different. For information about bindings for virtual buttons and keys, see VirtualBindings(3). iykyk πŸ’«


The whole squad, fr fr:

Composite(3), Constraint(3), Core(3), XmBulletinBoard(3), XmCreateSelectionBox(3), XmCreateSelectionDialog(3), XmCreatePromptDialog(3), XmManager(3), and XmSelectionBoxGetChild(3). πŸ«‚


And that's the whole page, bestie!! πŸŽ‰βœ¨ You made it to the bottom β€” main character energy fr. The little footer at the very end is stamped XmSelectionBox(library call) (that's the library-call source/version tag and its date, right there in the corner), so go forth and select some boxes. Slay, stay sensitive to your callbacks, and never let a <Key><osfCancel> catch you slipping. πŸ’–πŸŒΈπŸ¦‹