XMVACREATESIMPLEOPTIONMENU(3)

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

✨ 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 from 0 (zero) to the number of buttons in the menu minus 1.
  • every separator is named separator_n, where n is an integer from 0 (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 which PushButtonGadget is initially set. the value is the integer n that corresponds to the nth PushButtonGadget specified in the variable portion of the argument list. ⚠️ only a PushButtonGadget can be set, and only PushButtonGadgets are counted in determining the integer n. the first PushButtonGadget is number 0 (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's XmNactivateCallback. the callback function is called when a button is activated, and the button number is returned in the client_data field. 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 a PushButtonGadget. Following are the additional four arguments, in order:
    • label β€” the label string, of type XmString.
    • mnemonic β€” the mnemonic, of type KeySym.
    • accelerator β€” the accelerator, of type String.
    • accelerator_text β€” the accelerator text, of type XmString.
  • 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 is XmDOUBLE_LINE. yes she's extra πŸ’…
  • resource_name β€” this is followed by one additional argument, the value of the resource, of type XtArgVal. 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 type String.
    • type β€” the type of the resource value supplied, of type String.
    • value β€” the resource value (or a pointer to the resource value, depending on the type and size of the value), of type XtArgVal.
    • size β€” the size of the resource value in bytes, of type int.
  • XtVaNestedList β€” this is followed by one additional argument of type XtVarArgsList. This argument is a nested list of varargs returned by XtVaCreateArgsList. 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.



and that's the whole vibe bestie πŸ’– this was the XmVaCreateS...eOptionMenu page from the library call manual β€” go build something cute with it πŸŒˆβœ¨πŸ’œ