::tycho::TWidget
-
Source File -
Contents:
itk_options
- public methods
- protected variables
The MenuSupport code is designed with some assumptions about how menus will be used. First, all menus are accessed by name, including sub-menus. Second, as much as possible, menus and entries are accessed only by name -- for example, you can disable the menu entry "Undo" without knowing which menu the entry is contained in. This makes it easier for different widgets to manipulate a common set of menus, as well as requiring only one change rather than several if an entry needs to be moved. Third, the methods are very forgiving about "errors": for example, if you try to create an entry that already exists, then the new entry simply replaces the old one; if you try and disable a menu entry that does not exist, then the method silently does absolutely nothing, on the assumption that one piece of code somewhere deleted that entry and it's just easier for you not to have to know this (this is very easy to do with a class hierarchy in which menus are manipulated at different levels of the hierarchy.) What this means is that if you do make an error, such as disabling a non-existent menu entry, you will not be notified of the mistake, so be careful.
-font
[::tycho::font
-padx
5
-pady
4
add
name inMenu args
-type
option can be used to choose
a different type of entry. Some common options are:
-type
type: Select the type of entry. Can be command
(the default), cascade (for sub-menus), radiobutton, or
checkbutton.
-command
command: The command to be executed when the entry is
selected.
-underline
index: Underline the character of the entry name
specified by index.
-accelerator
string: Display string next to the entry name.
Any other options understood by the add
method of the Tk menu widget
can be given, except for -menu
and -label
. If there is already
an entry with the specified name, this method silently replaces the old
entry with the new entry. Note that the options apply only to the
newly created entry -- if creating a submenu, this means that only
the options to the entry, not the menu itself, are set: use the
menuconfigure
method to set the options of the submenu.
addSeparator
inMenu args
add separator
command.
clear
menu
delete
name
disable
name
empty
name
enable
name
entrycget
name option
entryconfigure
name args
insert
name before args
insertSeparator
before
menuname
name
menucget
name option
menuconfigure
name args
itemtype
menupath
entrypath