Next: Suggestions for future changes/additions
Up: PopupMenu
Previous: Nonvirtual member functions
PopupMenu objects are used in the following way:
- A PopupMenu instance is created, that is initially empty.
- The user calls PopupMenu->add_item to add commands, until the
menu is defined. This will return integer ``return codes''
for the items added, which must be remembered by the caller.
- If there is a hierarchy of menus, first create submenus just as
regular menus are created, and then create the parent menu by using the
same method and using the add_submenu routine to attach the submenus
to the parent menu.
- When the menu is defined, and it is to be used, the menu creator
should call PopupMenu->activate(), which returns either a pointer
to a PopupMenuItem, or NULL if nothing was selected. The
caller can use this item to determine the return code and the text command.
See the source code of the Mouse class for an example of the use of
PopupMenu.
Justin Gullingsrud
Tue Apr 6 09:26:48 CDT 1999