-activebackground -borderwidth -foreground -activeforeground -disabledcolor -relief -background -font
A menu is a widget that displays a collection of one-line entries arranged in a column. There exist several different types of entries, each with different properties. Entries of different types may be combined in a single menu. Menu entries are not the same as entry widgets. In fact, menu entries are not even distinct widgets; the entire menu is one widget.
Menu entries are displayed with up to three separate fields. The main field is a label in the form of a text string, a bitmap, or an image, controlled by the -label, -bitmap, and -image options for the entry. The second field is a marker for cascade entries, showing that the entry will post a cascade menu. It is displayed at the right-hand edge of the entry. The third field is an indicator. The indicator is present only for checkbutton or radiobutton entries. It indicates whether the entry is selected or not, and is displayed to the left of the entry's string.
In normal use, an entry becomes active (displays itself differently) whenever the mouse pointer is over the entry. If a mouse button is released over the entry then the entry is invoked. The effect of invocation is different for each type of entry; these effects are described below in the sections on individual entries.
Entries may be disabled, which causes their labels and accelerators to be displayed with dimmer colours. The default menu bindings will not allow a disabled entry to be activated or invoked. Disabled entries may be re-enabled, at which point it becomes possible to activate and invoke them again.
A cascade entry posts its associated menu by invoking a Tk command of the form
menu post x y
menu unpost
If a -command option is specified for a cascade entry then it is evaluated as a Tk command whenever the entry is invoked.
pathName option ?arg arg ...?
Many of the widget commands for a menu take as one argument an indicator of which entry of the menu to operate on. These indicators are called indexes and may be specified in any of the following forms:
The following widget commands are possible for menu widgets:
The add widget command returns an empty string.
Disabled menu entries are non-responsive: they don't activate and they ignore mouse button presses and releases.
The behaviour of menus can be changed by defining new bindings for individual widgets.
MENU(9 ) | Rev: Thu Feb 15 14:44:05 GMT 2007 |