
7. The Menu Widget 21
-postcommand => callback
Specify callback to invoke immediately before the menu
is posted.
-selectcolor => color
Specifies indicator color for checkbutton and radiobutton
entries.
-tearoff => boolean
Whether to include a tear-off entry at top of menu.
-tearoffcommand => callback
Specifies command to be run when menu is torn off. The
name of the menu and the new torn-off window will be
appended on invocation.
-title => string
Uses string for window title when the menu is torn off.
-type => type
Used during creation to specify
menubar, tearoff, or
normal.
Entry Types:
cascade, checkbutton, command,
radiobutton, separator
Menu Indices: number (starts at 0, normally the tearoff
item),
active, last, none, @y,
matchPattern
Menu Widget Commands
$menu->activate(index);
Changes state of entry at index to be sole active entry in
menu.
$menu->add(type ?, -option => value ... ?);
Adds new entry of type type to bottom of menu. See
below for options.
$menu->cascade(?-option => value ... ?);
Adds new cascade entry to bottom of menu. See below
for options.