From the point of view of the PyGUI API, a Menu is a collection of commands
that the user can invoke. The manner in which these commands are made available
to the user is platform-dependent, but typically a Menu instance will correspond
to a pull-down menu in a menu bar.
At any given moment, two sets of menus are available to the user, a set of application-wide menus determined by the menus attribute of the application object, and a set of window-specific menus determined by the menus attribute of the currently active window.
A menu consists of a sequence of menu items, each of which has the following characteristics:
A menu item can stand alone, or it can be part of an indexed group
of items which share the same command name and are distinguished by an integer
index. Examples of uses for indexed groups include a list of window titles
in a "Windows" menu, or a list of font names in a "Font" menu.
A menu can also contain separators for dividing items into visual groupings.
The label, keyboard equivalent and command name of a stand-alone menu item
are established when the menu is created and cannot be changed thereafter,
other than by discarding the whole Menu instance and creating a new one.
In contrast, the enabled/disabled status and check mark of each item, and
the contents of indexed groups, is established dynamically during the setup
phase of menu command processing. See Menu
Setup for more information.
When a menu item is invoked by the user, its associated command name is
sent as a message up the message handling path starting from the current
target (see Event Handling). If the item
is part of an indexed group, its index is passed as a parameter of the message.
- title
- Read-only. Title of the menu, to appear in the menu bar.