Name
menu
- menu
pathName [option value
...] The menu command creates a new menu widget named
pathName
. A menu is a top-level window that displays a collection of one-line entries arranged in one or more columns. Several different types of menu entries exist and can be combined in a single menu.
Standard Options
-activebackground | -activeborderwidth | -activeforeground |
-background | -borderwidth | -cursor |
-disabledforeground | -font | -foreground |
-relief | -takefocus |
Widget-Specific Options
- -postcommand command
(
postCommand
,Command
) Command to evaluate each time the menu is posted.
- -selectcolor
color
(selectColor
,Background
) Color to display in the indicator when menu entries of type
checkbutton
orradiobutton
are selected.- -tearoff
boolean
(tearOff
,TearOff
) Whether the menu should include a tear-off entry at the top.
- -tearoffcommand
command
(tearOffCommand
,TearOffCommand
) Command to evaluate whenever menu is torn off. The menu widget’s name and the name of the window for the torn-off menu are appended as the last two arguments.
- -title
string
(title
,Title
) String to use as a title for the window created when the menu is torn off.
- -type
type
(type
,Type
) Menu’s type.
Type
must be menubar,tearoff
, ornormal
. Can only be set at menu’s creation.
Entry Indices
Several menu widget methods support the notion of an
index
for identifying a particular entry
position within the menu. Indices have the following form:
number
The entry numerically, where 0 is the topmost entry.
active
The entry that is currently active.
end
The bottommost ...
Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.