You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_OptionMenu object:
Cvo_OptionMenu
Cvo_Window
#include
<Cvo/OptionMenu.h++>
new
Cvo_OptionMenu ( char *resource_name,
{ Cvo_Object *parent | Display *display },
Cvo_MenuItem *menu )
A Cvo_OptionMenu object creates a Cvo_MenuLabel, which when pressed, causes a Cvo_Menu of selections to appear over it. The menu argument gives the entries which will appear on the Cvo_Menu object. The label will always display the last selected entry of the menu. See the Cvo_Menu object for a list of events which may be generated by this object.
To add entries to this object's Cvo_Menu, refer to the
Cvo_MenuEntry object. The MenuEntries()
member function will
return a list Cvo_MenuEntry objects, which is necessary to add
entries to the menu.
This object defines the following member functions in addition to those defined by its parent and ancestor objects.
Cvo_MenuEntry *MenuEntries (
)
This function returns the first element of a linked list of Cvo_MenuEntry objects. This list contains one object for each entry on the menu.
This function returns the Cvo_Menu which will be displayed over this object.
MakeCurrent (
Cvo_MenuEntry *item,
[ BOOL call ] )
This function makes item the currently displayed item. This implies that the text in the label will change to match the text for the menu entry item.
The optional argument call specifies whether or not the event
handler function for the specified Cvo_MenuEntry should be called.
By default, this is True
.
This object defines the following event translations in addition to those defined by its parent and ancestor objects.
<ButtonPress>
:
Press()
This translation causes the Cvo_Menu to be displayed over this object. The entry selected from the Cvo_Menu will be displayed in this object's Cvo_MenuLabel.
This object modifies the following X resources which are used by its parent or other ancestors.
*CvoOptionMenu.option_dimple.Chamfer
(new value:
2
)
*CvoOptionMenu.Cursor
(new value:
Top Left Arrow
)
*CvoOptionMenu.Pad
(new value:
2
)
*CvoOptionMenu.Etched
(new value:
True
)
*CvoOptionMenu.FontWeight
(new value:
Bold
)
See the example source code for an example of how to use this object.
See the legend for information about the conventions used in this documentation.