Next: Method of use
Up: PopupMenu
Previous: Internal data structures
- char *name(void) - return the name of this menu.
- int items(void) - return the number of items in this menu.
- PopupMenuItem *menu_item(int) - return the Nth item, or NULL
if N is not in range.
- PopupMenuItem *menu_item(char *) - return the first
menu item with the given name (label), or NULL if not found.
- PopupMenuItem *find_item(int, PopupMenu * = NULL) - given a
specific return code as the first argument, this searches the menu specified
in the second argument until the first item with that return code is found.
This returns the item object if found, or NULL if not found or the given
return code is
. The second argument is used to allow for
recursive searching of submenus, and should not be specified by the user
when calling this function.
- int add_item(char *name, char *cmd, int disp, int mark, int
onoff=0) - This adds a new item to the end of the current menu. The item
will appear in the menu with the given name, and will have the given string
`cmd' be associated with this item. The return code of the new item is
returned. The other flags in the argument specify the following:
- int disp: whether to display the item or not (it can be turned
on/off later by routines in PopupMenuItem).
- int mark: whether to put a check box by the object or not.
- int onoff: if mark is TRUE, then the check mark can either be
shown as an empty box (onoff=FALSE), or as a checked box (onoff=TRUE). If
mark is FALSE, this is ignored.
- int add_submenu(PopupMenu *, int disp, int mark, int onoff=0)
- Adds a submenu to the end of the menu. The submenu must have been
created previously. The name of the submenu is used as the name shown in
the current menu. The other arguments are as described for add_item.
Returns success.
- int add_separator(void) - adds a separator to the end of the
menu. Returns success.
- int delete_item(int) - delete the Nth item from the menu.
Returns success.
- PopupMenuItem *activate(DisplayDevice *) - requests the the
menu be given to the specified DisplayDevice to be activated by
the windowing system. Virtual functions in DisplayDevice are used to
create the menu, and to get the user's choice from the menu. This returns
a pointer to the PopupMenuItem object for the item selected, or NULL
if no item is selected.
Next: Method of use
Up: PopupMenu
Previous: Internal data structures
Justin Gullingsrud
Tue Apr 6 09:26:48 CDT 1999