You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_MenuEntry object:
Cvo_MenuEntry
#include
<Cvo/Menu.h++>
new
Cvo_MenuEntry ( Cvo_Menu *menu,
Cvo_MenuItem *item,
[ Cvo_MenuEntry *entry ] )
new
Cvo_MenuEntry ( Cvo_Menu *menu,
Cvo_Window *label,
[ Cvo_MenuEntry *entry ],
[ Cvo_MenuFunc func, [ void *data ] ],
[ int flags ] )
This object represents entries in menu objects, such as the Cvo_Menu object. It has two major varieties of construction methods.
The first method shown requires a menu argument, which is the Cvo_Menu object which will contain this entry. The next required argument is item, a pointer to a Cvo_MenuItem object. The Cvo_MenuItem object is a structure containing all the information needed to construct a menu entry. The entry object is optional. If it is provided, it should be a pointer to a Cvo_MenuEntry object on menu, and the new Cvo_MenuEntry object will be placed before it in the display hierarchy.
The second method permits the construction of menu entries which do
not display default menu labels. While the first method will create a
Cvo_MenuLabel object for the entry, this method allows the user to
specify which Cvo object will be displayed on the menu. The first
argument, menu, is the Cvo_Menu object which will contain this
entry. The next required argument is label, a pointer to a Cvo
object derived from Cvo_Window. This Cvo object will be displayed on
the menu. The entry object is optional. If it is provided, it
should be a pointer to a Cvo_MenuEntry object on menu, and the new
Cvo_MenuEntry object will be placed before it in the display
hierarchy. The func argument should be an event hander function provided to
handle CvoMenuEvent
events. It should be of the form
void func(Cvo_Object *, XEvent *, void *)
. The data argument is
data which will be passed to the func event handler function. The
flags argument should be arguments describing the type of menu
entry this is. These menu flags are described in the Cvo_MenuItem
object documentation.
To remove an entry from a menu, simply delete the Cvo_MenuEntry object corresponding to that menu entry.
This object defines the following public data members.
Cvo_Menu *menu
The Cvo_Menu which owns this object.
Cvo_Window *label
The Cvo_Window which is displayed as the label for the Cvo_MenuEntry. If the Cvo_MenuEntry did not have a Cvo_Window specifically provided as the label, then the Cvo_MenuEntry object will create a Cvo_MenuLabel object as the label.
void *data
This is the client data provided either as an argument or in the Cvo_MenuItem object.
int flags
These are the flags provided either as an argument or in the Cvo_MenuItem object.
Cvo_MenuFunc func
This is the event handler function provided either as an argument or in the Cvo_MenuItem object.
Cvo_Menu *cascade
If the Cvo_MenuEntry is a cascade menu entry, then this will point to the Cvo_Menu which the entry is intended to display when selected. This is provided in the data element of the Cvo_MenuItem object, or as the data argument to this Cvo_MenuEntry object.
This object defines the following member functions.
Call (
)
This function duplicates the action that happens when the menu entry
represented by the Cvo_MenuEntry object is selected by the user. This
involves sending the CvoMenuEvent
to the event handler function
for this object, if one has been provided.
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.