XMDROPDOWN(3)
π XmDropDown π
okay bestie, welcome to XmDropDown(3) β library call energy, DropDown widget class realness, and honestly? she's a whole vibe. this is part 1 of 5 so buckle up, we're not even close to done π
β¨ NAME β¨
XmDropDown β the DropDown widget class. no cap, that's literally the whole name section. iconic of her π
β¨ SYNOPSIS β¨
#include <Xm/DropDown.h>
that's it. that's the whole synopsis. one include, and you're in π¦
β¨ DESCRIPTION β¨
okay so picture this: the DropDown widget lets the user pick stuff out of a list of choices, and type their own little custom values into a text widget. she's versatile like that πβοΈ
but here's the space-saving slay: to conserve screen space, the list of choices is only shown when the user taps the down arrow button. then the choices can be selected from that list. lowkey genius.
- if the list widget is in Browse Select mode (which is the default, bestie) or Single Select mode, the list gets automatically removed the second the user selects an item in it. gone. poof. β¨
- when the list is in other modes, multiple items may be selected, and the list may be popped down by either:
- another click on the arrow button,
- a click outside the list, or
- double-clicking an item.
now for the keyboard traversal girlies β¨οΈ β the list may be popped down by selecting the arrow button or Alt - down arrow, and popped back up by typing either the osfActivate key, a carriage return, or Alt - up arrow. periodt.
in any case, when the list is removed, the item or items that were selected will be placed in the text widget separated by commas. so like, a, b, c energy π
typing the escape key when the list is up cancels the list popup, restoring the DropDown widget to the state it was in before the list was popped up. it's giving "undo my curiosity" π
and if the text field area is non-editable? clicking anywhere in the text field β the list will also pop down. sneaky little shortcut, we love her π
resources are available to change:
- the margin sizes,
- the location of the left edge of the popup list,
- whether or not the label is shown,
- whether the text field widget may be edited, and
- whether or not the text in the list is verified against the choices available in the list.
and by setting resources that occur in the children of the DropDown widget, you can set or dynamically change:
- the contents of the list,
- the number of items visible in the list,
- the initial value of the text field, and
- the value of the label.
π if a developer wishes the popup list's shell to be resizable, they should setallowShellResizetoTrueat creation time. creation time only, bestie, don't come crying to me later.
πΈ Classes πΈ
XmDropDown inherits behavior, resources, and traits from Core, Composite, and XmManager classes.
- the class pointer is
xmDropDownWidgetClass. - the class name is
XmDropDown.
family tree moment π
π New Resources π
okay so here's the table of widget resources the programmer uses to specify data. the programmer can also set the resource values for the inherited classes to set attributes for this widget. keep up π«
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 mean:
Cβ can be set at creation timeSβ can be set by usingXtSetValuesGβ can be retrieved by usingXtGetValuesN/Aβ not applicable
π XmDropDown Resource Set π
every single one, in order, no skipping:
XmNcustomizedCombinationBoxβ classXmCBoolean, typeBoolean, defaultFalse, accessCSGXmNeditableβ classXmCBoolean, typeBoolean, defaultTrue, accessCSGXmNhorizontalMarginβ classXmCMargin, typeDimension, default2, accessCSGXmNitemCountβ classlist, typeint, default0, accessCSGXmNitemsβ classlist, typeXmStringTable, defaultNULL, accessCSGXmNlabelStringβ classlabel, typeXmString, default"label", accessCSGXmNpopupCursorβ classXmCCursor, typeCursor, defaultleft_ptr, accessCSGXmNpopupOffsetβ classMxCPopupOffset, typeint, default15, accessCSGXmNpopupShellWidgetβ classXmCWidget, typeWidget, defaultNULL, accessCSGXmNshowLabelβ classXmCBoolean, typeBoolean, defaultTrue, accessCSGXmNupdateShellCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCSGXmNupdateTextCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCSGXmNuseTextFieldβ classXmCUseTextField, typeBoolean, defaultTrue, accessCSGXmNvalueβ classtext, typeString, default"", accessCSGXmNverifyβ classXmCVerify, typeBoolean, defaultTrue, accessCSGXmNverifyTextCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCSGXmNverticalMarginβ classXmCMargin, typeDimension, default2, accessCSGXmNvisibleItemCountβ classXmCVisibleItemCount, typeint, default0, accessCSG
that's eighteen resources and every single one of them said CSG, we stay consistent π
π and that's the end of part 1! more parts incoming, don't go anywhere bestie π«Ά
XmNcustomizedCombinationBoxβ bestie, if you set this toTrue, the widget will NOT go make a popup shell and list widget for you on its own β¨. The name is literally the whole vibe: it's for when you wanna build a custom combination box that has something other than a list inside it. And if this resource is true, you must hand the DropDown widget a shell via thepopupShellWidgetresource, okay? Just before the shell pops up,updateShellCallbackgets called. Just after the shell pops down,updateTextCallbackgets called. And ifverifyis true, thenverifyTextCallbackgets called whenever the combo box needs to check the contents of the text widget against the allowable values in the custom shell. πXmNeditableβ a boolean that decides whether the user is even allowed to type into the TextField widget of the DropDown widget. And listen: if this value isFalse, then selecting the text field will popup the combo box list instead. it's giving "no typing for you, only choosing" πXmNhorizontalMarginβ this one specifies the horizontal spacing between the child widgets and the boundary of the DropDown widget. the breathing room, if you will πΈXmNverticalMarginβ same energy but vertical: the vertical spacing between the child widgets and the boundary of the DropDown widget.XmNitemCountβ literally just the number of items in the popup list. that's it, that's the resource πXmNitemsβ the list of all choices that will be displayed in the popup list.XmNlabelStringβ the string displayed as the label of the DropDown widget. the little name tag, iconic β¨XmNpopupCursorβ the cursor to show the user when the DropDown's list is popped up. For your choices, go see X Window System, Robert Scheiffler et al., Appendix B. π¦XmNpopupOffsetβ the amount of space in pixels between the left edge of the Text widget and the left edge of the list when the list is displayed. Positive values mean the text's left edge is farther to the left; negative values mean the list's edge is farther to the left. And heads up: if this is a non-custom DropDown widget, the right edge of the text and the right edge of the arrow button will always line up. no cap.XmNpopupShellWidgetβ the widget identifier for the shell that pops up when the arrow is clicked. IfcustomizedCombinationBoxisFalse, then this widget is automatically created by the DropDown widget. so convenient fr fr π«ΆXmNshowLabelβ a boolean that says whether or not to display the DropDown Label widget. show it or don't, your call bestie πXmNupdateShellCallbackβ (yes, the original just lists it right here, no separate description, we keep it 100)XmNupdateTextCallbackβ the callback routine to call when either the shell widget contents or the Text widget need to be updated to correspond with the other. The shell is updated just before it is popped up. The text is updated just after the shell is popped down. IfcustomizedComboBoxisFalse, then the updates are done automatically by the combo box. These routines get called to inform the application that an action has been taken, in case it would like to do any further processing. considerate king behavior πXmNuseTextFieldβ a boolean that specifies if anXmTextFieldor anXmTextwidget should be used for the text entry portion of the DropDown widget.XmNvalueβ the string displayed in the Text widget. simple, elegant, iconic β¨XmNverifyβ if this resource is true, the DropDown widget will verify its value against the list whenever it loses focus or the user types<Carriage Return>. If the verification fails, anXtWarningis generated with a name ofXmNtextVerifyFailed. Wanna trap this message? Register anXtWarningMsgHandler. π
okay so this next bit matters: verification failure =XtWarningnamedXmNtextVerifyFailed, and to catch it you register anXtWarningMsgHandler. that's the whole vibe check. π
XmNverifyTextCallbackβ this routine is called whenever the Text widget's contents may need to be verified against the popup shell's contents. If thecustomizedComboBoxresource isFalse, then the DropDown widget has already performed the verification by the time this routine is called. so you're getting the post-verification tea βXmNvisibleItemCountβ the number of items visible in the popup list at one time. the window into the list, if you will πͺ
π§Έ Children π§Έ
The DropDown is composed of many sub-widgets. Most of the information displayed to the user is set through these sub widgets. Most values passed to this widget through the argument list at creation time or via set values are passed to each of this widget's children. Get values requests must be made on a child by child basis. The children of the DropDown are listed below. The OSF/Motif documentation should be consulted for an exhaustive set of resources for each child. A partial list of the most common resources are listed here for convenience.
XmDropDownβ comboBoxXmLabelβ labelXmTextFieldβ textXmArrowButtonβ arrowOverrideShellβ popupShellXmScrolledWindowβ listSWXmScrollBarβ ListvScrollBarXmScrollBarβ ListhScrollBarXmListβ list
The popup shell and its children are only created when customizedCombinationBox is False. don't forget it bestie, it's lowkey important π
π Inherited Resources π
XmDropDown 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.
πΈ XmManager Resource Set πΈ
okay bestie, deep breath, because this is the resource set every XmManager subclass inherits and we are listing every single one π columns are Name, Class, Type, Default, and Access, and nobody gets skipped, not even the pixmaps π«Ά
XmNbottomShadowColorβ classXmCBottomShadowColor, typePixel, defaultdynamic, accessCSGπ the bottom-shadow colour, and yes it figures itself out at runtime, iconicXmNbottomShadowPixmapβ classXmCBottomShadowPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGβ¨XmNforegroundβ classXmCForeground, typePixel, defaultdynamic, accessCSGπΈXmNhelpCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCπXmNhighlightColorβ classXmCHighlightColor, typePixel, defaultdynamic, accessCSGβ¨XmNhighlightPixmapβ classXmCHighlightPixmap, typePixmap, defaultdynamic, accessCSGπXmNinitialFocusβ classXmCInitialFocus, typeWidget, defaultNULL, accessCSGπ¦XmNlayoutDirectionβ classXmCLayoutDirection, typeXmDirection, defaultdynamic, accessCGπXmNnavigationTypeβ classXmCNavigationType, typeXmNavigationType, defaultXmTAB_GROUP, accessCSGπXmNpopupHandlerCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCπ«XmNshadowThicknessβ classXmCShadowThickness, typeDimension, default0, accessCSGβ zero, fr fr, no cap πXmNstringDirectionβ classXmCStringDirection, typeXmStringDirection, defaultdynamic, accessCGπ§XmNtopShadowColorβ classXmCTopShadowColor, typePixel, defaultdynamic, accessCSGβXmNtopShadowPixmapβ classXmCTopShadowPixmap, typePixmap, defaultdynamic, accessCSGπXmNtraversalOnβ classXmCTraversalOn, typeBoolean, defaultTrue, accessCSGπ₯XmNunitTypeβ classXmCUnitType, typeunsigned char, defaultdynamic, accessCSGπXmNuserDataβ classXmCUserData, typeXtPointer, defaultNULL, accessCSGπ
ok and about that Access column, because it's giving cryptic:Cmeans the resource is set at creation time,Gmeans you can get it, andSmeans you can set it. SoCSG= all three, no notes π
π Composite Resource Set π
okay bestie, first little crew of resources. here's the whole lineup, no skips:
XmNchildrenβ classXmCReadOnly, typeWidgetList, defaultNULL, accessGπ«Ά read-only, so look but don't touch.XmNinsertPositionβ classXmCInsertPosition, typeXtOrderProc, defaultNULL, accessCSGβ this is the lil' procedure that decides where new kiddos get slotted in.XmNnumChildrenβ classXmCReadOnly, typeCardinal, default0, accessGβ literally just how many children there are. that's it. read-only, periodt.
β¨ Core Resource Set β¨
and now the big one, the core resource set. it's giving main character energy because literally every widget inherits these. buckle up, it's a long list and we're not skipping a single one π
XmNacceleratorsβ classXmCAccelerators, typeXtAccelerators, defaultdynamic, accessCSGXmNancestorSensitiveβ classXmCSensitive, typeBoolean, defaultdynamic, accessGβ read-only vibes only.XmNbackgroundβ 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, accessCGβ note the access isCGnotCSG, she's different πXmNdepthβ 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
ngl, dynamic just means the toolkit figures that default out at runtime, bestie. it's not a fixed number, it's a whole vibe. π¦
and yes, those access codes matter: C means you can set it at creation, S means you can set it later, G means you can get it. so CSG is the full triple threat π, CG is create + get only, and G alone is peek-only, no setting allowed. iykyk.
βββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββΌβββββββββββββββββΌβββββββββββββββββββββββΌβββββββββ€
βββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββ΄βββββββββββββββββ΄βββββββββββββββββββββββ΄βββββββββ
okay bestie that's the end of the table, we're moving on π
Callback Information π
None of the DropDown's callback procedures have any call data currently defined for them. Like, zero. The widget passed to each of these functions is the DropDown widget.
void (Callback)(Widget cbw, XtPointer client_data, XtPointer unused)
cbwβ This is the widget identifier of the DropDown widget. (the main character widget itself β¨)client_dataβ The client data passed to this widget by the application programmer.unusedβ This value is undefined. (don't worry about it, it's giving mystery π΅οΈβοΈ)
Geometry Management π
The DropDown widget lays out its children (the label, text and arrow) in a row. The amount of space they are each allocated when the DropDown is not allowed to be the exact size it desires is determined using the following rules:
- The arrow is always given its requested size. (arrow said "I want this much" and the widget said "bet" π―)
- If the combo box is bigger than it wants to be all extra space is given to the text widget.
- If the combo box is smaller than it wants to be then the text and label widgets are each sized smaller than they desire in exactly the same ratio.
For example:
If the amount of space for the label and text is 100 pixels and the label wants to be 50 pixels wide and the text would like to be 100 pixels wide then the label will get 34 pixels and the text 66.
The popup shell widget is sized such that the width of the scrolled list widget equals the width of the text widget minus the value of the "popupOffset" resource. If the popup shell resides in a customized combination box, however, it is allowed to be whatever size the child of the popup shell would like to be. (popup shell said "I'm flexible, bestie" π)
RELATED π¦
Composite(3), Core(3), XmCreateDropDown(3), XmDropDownGetArrow(3), XmDropDownGetLabel(3), XmDropDownGetList(3), XmDropDownGetText(3), XmDropDownGetValue(3), XmList(3), XmManager(3), XmTextField(3), XmVaCreateDropDown(3), and XmVaCreateManagedDropDown(3).
COPYRIGHT π
Copyright (c) 1992 by Integrated Computer Solutions, Inc.
and that's a wrap, bestie π this page is XmDropDown(library call), copyright 1992 by Integrated Computer Solutions, Inc. β slay, iconic, periodt. π«Ά
π¦ 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