1XmCreateOptionMenu(library call) XmCreateOptionMenu(library call)
2
3
4
6 XmCreateOptionMenu — A RowColumn widget convenience creation function
7
9 #include <Xm/RowColumn.h>
10 Widget XmCreateOptionMenu(
11 Widget parent,
12 String name,
13 ArgList arglist,
14 Cardinal argcount);
15
17 XmCreateOptionMenu creates an instance of a RowColumn widget of type
18 XmMENU_OPTION and returns the associated widget ID.
19
20 It is provided as a convenience function for creating a RowColumn wid‐
21 get configured to operate as an OptionMenu and is not implemented as a
22 separate widget class.
23
24 The OptionMenu widget is a specialized RowColumn manager composed of a
25 label, a selection area, and a single Pulldown menu pane. When an
26 application creates an OptionMenu widget, it supplies the label string
27 and the Pulldown menu pane. In order for the operation to be success‐
28 ful, there must be a valid XmNsubMenuId resource set when this function
29 is called. The LabelGadget and the selection area (a CascadeButtonGad‐
30 get) are created by the OptionMenu.
31
32 The OptionMenu's Pulldown menu pane must not contain any ToggleButtons
33 or ToggleButtonGadgets. The results of including CascadeButtons or
34 CascadeButtonGadgets in the OptionMenu's Pulldown menu pane are unde‐
35 fined.
36
37 An OptionMenu is laid out with the label displayed on one side of the
38 widget and the selection area on the other side when XmNorientation is
39 XmHORIZONTAL. The layout of the label with respect to the selection
40 area depends on the XmNlayoutDirection resource in the horizontal ori‐
41 entation. If the value is XmVERTICAL, the label is above the selection
42 area. The selection area has a dual purpose; it displays the label of
43 the last item selected from the associated Pulldown menu pane, and it
44 provides the means for posting the Pulldown menu pane.
45
46 The OptionMenu typically does not display any 3-D visuals around itself
47 or the internal LabelGadget. By default, the internal CascadeButtonGad‐
48 get has a visible 3-D shadow. The application may change this by get‐
49 ting the CascadeButtonGadget ID using XmOptionButtonGadget, and then
50 calling XtSetValues using the standard visual-related resources.
51
52 The Pulldown menu pane is posted when the mouse pointer is moved over
53 the selection area and a mouse button that is defined by OptionMenu's
54 RowColumn parent is pressed. The Pulldown menu pane is posted and
55 positioned so that the last selected item is directly over the selec‐
56 tion area. The mouse is then used to arm the desired menu item. When
57 the mouse button is released, the armed menu item is selected and the
58 label within the selection area is changed to match that of the
59 selected item. By default, BSelect is used to interact with an Option‐
60 Menu. The default can be changed with the RowColumn resource XmNmenu‐
61 Post.
62
63 The OptionMenu also operates with the keyboard interface mechanism. If
64 the application has established a mnemonic with the OptionMenu, press‐
65 ing <Alt> with the mnemonic causes the Pulldown menu pane to be posted
66 with traversal enabled. The standard traversal keys can then be used
67 to move within the menu pane. Pressing <Return> or typing a mnemonic or
68 accelerator for one of the menu items selects that item.
69
70 An application may use the XmNmenuHistory resource to indicate which
71 item in the Pulldown menu pane should be treated as the current choice
72 and have its label displayed in the selection area. By default, the
73 first selectable item in the Pulldown menu pane is used.
74
75 parent Specifies the parent widget ID
76
77 name Specifies the name of the created widget
78
79 arglist Specifies the argument list
80
81 argcount Specifies the number of attribute/value pairs in the argument
82 list (arglist)
83
84 The user can specify resources in a resource file for the automatically
85 created widgets and gadgets of an OptionMenu. These widgets (or gad‐
86 gets) and the associated OptionMenu areas are
87
88 Option Menu Label Gadget
89 OptionLabel
90
91 Option Menu Cascade Button
92 OptionButton
93
94 For a complete definition of RowColumn and its associated resources,
95 see XmRowColumn(3).
96
98 Returns the RowColumn widget ID.
99
101 XmCascadeButtonGadget(3), XmCreatePulldownMenu(3), XmCreateSimpleOp‐
102 tionMenu(3), XmLabelGadget(3), XmOptionButtonGadget(3), XmOptionLabel‐
103 Gadget(3), XmRowColumn(3), and XmVaCreateSimpleOptionMenu(3).
104
105
106
107 XmCreateOptionMenu(library call)