XMVACREATESIMPLEOPTIONMENU(3)
β¨ NAME β¨
XmVaCreateSimpleOptionMenu β a RowColumn widget convenience creation function. bestie it literally does the whole OptionMenu for you, we love a shortcut π«Ά
π SYNOPSIS π
#include <Xm/RowColumn.h>
Widget XmVaCreateSimpleOptionMenu(
Widget parent,
String name,
XmString option_label,
KeySym option_mnemonic,
int button_set,
XtCallbackProc callback);
π DESCRIPTION π
XmVaCreateSimpleOptionMenu makes you an instance of a RowColumn widget of type XmMENU_OPTION and hands back the associated widget ID. no cap. and it does it with the ANSI C variable-length argument list (varargs) calling convention, so you can just keep stacking args. obsessed.
This routine creates an OptionMenu and its Pulldown submenu, and that submenu is full of PushButtonGadget or CascadeButtonGadget children. here's the naming lore:
- every button is named
button_n, where n is an integer from0(zero) to the number of buttons in the menu minus 1. - every separator is named
separator_n, where n is an integer from0(zero) to the number of separators in the menu minus 1.
Buttons and separators get named and created in the exact order you specified them in the variable portion of the argument list. so, like, order matters bestie, don't come for me.
π¦ the actual arguments π¦
parentβ specifies the parent widget ID.nameβ specifies the name of the created widget.option_labelβ specifies the label string to be used on the left side of the OptionMenu.option_mnemonicβ specifies a keysym for a key that, when pressed by the user, posts the associated Pulldown menu pane.button_setβ specifies whichPushButtonGadgetis initially set. the value is the integer n that corresponds to the nthPushButtonGadgetspecified in the variable portion of the argument list. β οΈ only aPushButtonGadgetcan be set, and onlyPushButtonGadgets are counted in determining the integer n. the firstPushButtonGadgetis number0(zero).callbackβ specifies a callback procedure to be called when a button is activated. this callback function is added to each button after creation as the button'sXmNactivateCallback. the callback function is called when a button is activated, and the button number is returned in theclient_datafield. periodt.
π the variable portion of the argument list π
It's groups of arguments, okay? The first argument in each group is a constant or a string, and it decides which arguments follow in that group. And listen β the last argument in the list must be NULL. not optional. it's giving non-negotiable.
Following are the possible first arguments in each group of varargs:
XmVaPUSHBUTTONβ this is followed by four additional arguments. The set specifies one button in the OptionMenu's Pulldown submenu and some of its resource values. The button created is aPushButtonGadget. Following are the additional four arguments, in order:labelβ the label string, of typeXmString.mnemonicβ the mnemonic, of typeKeySym.acceleratorβ the accelerator, of typeString.accelerator_textβ the accelerator text, of typeXmString.
XmVaSEPARATORβ this is followed by no additional arguments. It specifies one separator in the OptionMenu's Pulldown submenu.XmVaDOUBLE_SEPARATORβ this is followed by no additional arguments. It specifies one separator in the OptionMenu's Pulldown submenu. The separator type isXmDOUBLE_LINE. yes she's extra πresource_nameβ this is followed by one additional argument, the value of the resource, of typeXtArgVal. The pair specifies a resource and its value for the Pulldown submenu.XtVaTypedArgβ this is followed by four additional arguments. The set specifies a resource and its value for the Pulldown submenu. A resource type conversion is performed if necessary. Following are the additional four arguments, in order:nameβ the resource name, of typeString.typeβ the type of the resource value supplied, of typeString.valueβ the resource value (or a pointer to the resource value, depending on the type and size of the value), of typeXtArgVal.sizeβ the size of the resource value in bytes, of typeint.
XtVaNestedListβ this is followed by one additional argument of typeXtVarArgsList. This argument is a nested list of varargs returned byXtVaCreateArgsList. nesting era πͺ
πΈ resource file glow-up πΈ
The user can specify resources in a resource file for the automatically created widgets and gadgets of an OptionMenu. The following list identifies the names of these widgets (or gadgets) and the associated OptionMenu areas:
- Option Menu Label Gadget β
OptionLabel - Option Menu Cascade Button β
OptionButton
For more information on variable-length argument lists, see the X Toolkit Intrinsics documentation.
A number of resources exist specifically for use with this and other simple menu creation routines. For a complete definition of RowColumn and its associated resources, see XmRowColumn(3). go read it, i'll wait π
π RETURN π
Returns the RowColumn widget ID. that's it. that's the return. she's simple, she's iconic.
π₯ RELATED π₯
and that's the whole vibe bestie π this was the XmVaCreateS...eOptionMenu page from the library call manual β go build something cute with it πβ¨π
π¦ 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