XmCreateOptionMenu(3Xm) — UNIX Programmer’s Manual
NAME
XmCreateOptionMenu — a RowColumn widget convenience creation function.
SYNOPSIS
#include <Xm/RowColumn.h> Widget XmCreateOptionMenu (parent, name, arglist, argcount)
Widgetparent;
Stringname;
ArgListarglist;
Cardinalargcount;
DESCRIPTION
XmCreateOptionMenu creates an instance of a RowColumn widget of type XmMENU_OPTION and returns the associated widget ID.
It is provided as a convenience function for creating a RowColumn widget configured to operate as an OptionMenu and is not implemented as a separate widget class.
The OptionMenu widget is a specialized RowColumn manager composed of a label, a selection area, and a single Pulldown MenuPane. When an application creates an OptionMenu widget, it supplies the label string and the Pulldown MenuPane. In order to succeed, there must be a valid XmNsubMenuId resource set when calling this function. When the OptionMenu is created, the Pulldown MenuPane must have been created as a child of the OptionMenu’s parent and must be specified. The LabelGadget and the selection area (a CascadeButtonGadget) are created by the OptionMenu.
An OptionMenu is laid out with the label displayed on the left side of the widget and the selection area on the right side. The selection area has a dual purpose; it displays the label of the last item selected from the associated Pulldown MenuPane, and it provides the means for posting the Pulldown MenuPane.
The OptionMenu typically does not display any 3-D visuals around itself or the internal LabelGadget. By default, the internal CascadeButtonGadget has a visible 3-D shadow. The application may change this by getting the CascadeButtonGadget ID using XmOptionButtonGadget and then calling XtSetValues using the standard visual-related resources.
The Pulldown MenuPane is posted by moving the mouse pointer over the selection area and pressing the mouse button defined by OptionMenu’s XmNwhichButton resource. The Pulldown MenuPane is posted and positioned such that the last selected item is directly over the selection area. The mouse is then used to arm the desired menu item. When the mouse button is released, the armed menu item is selected and the label within the selection area is changed to match that of the selected item. By default, mouse button 1 is used to interact with an OptionMenu. The default can be changed via the RowColumn resource XmNwhichButton.
The OptionMenu also operates by using the keyboard interface mechanism. If the application has established a mnemonic with the OptionMenu, typing the mnemonic causes the Pulldown MenuPane to be posted with traversal enabled. The standard traversal keys can then be used to move within the MenuPane. Selection can occur as the result of pressing the Return key or typing a mnemonic or accelerator for one of the menu items.
An application may use the XmNmenuHistory resource to indicate which item in the Pulldown MenuPane should be treated as the current choice and have its label displayed in the selection area. By default, the first item in the Pulldown MenuPane is used.
parentSpecifies the parent widget ID.
nameSpecifies the name of the created widget.
arglistSpecifies the argument list.
argcountSpecifies the number of attribute/value pairs in the argument list (arglist).
For a complete definition of RowColumn and its associated resources, see XmRowColumn(3Xm).
RETURN VALUE
Returns the RowColumn widget ID.
RELATED INFORMATION
XmCascadeButtonGadget(3Xm), XmCreatePulldownMenu(3Xm), XmLabelGadget(3Xm), and XmRowColumn(3Xm).
7th Edition