Menubutton Methods
In addition to configure
and cget, the following methods
are defined for Menubutton widgets:
AddItemsAdds menu items to the end of the menu. The arguments to
AddItemsare lists configuring each menu item, similar to the lists defined with the-menuitemoption.$menubutton->AddItems([command => "Print", -command => \&printscreen ], [command => "Exit", -command => \&exitclean ]);commandAdds a command item to the end of the menu. The above example could have read:
$menubutton->command(-label => "Print", -command => \&printscreen); $menubutton->command(-label => "Exit", -command => \&exitclean);
checkbuttonAdds a checkbutton item to the end of the menu:
$menubutton->checkbutton(-label => "Show Toolbar", -variable => \$toolbar);radiobuttonAdds a radiobutton item to the end of the menu:
$menubutton->radiobutton(-label => "Red", -variable => \$color); $menubutton->radiobutton(-label => "Blue", -variable => \$color);
separatorAdds a separator line to the end of a menu.
cascadeAdds a cascade item to the end of the menu.
menuReturns a reference to the menu.
entrycgetGets information on a menu entry given an index and option to query.
entryconfigureChanges information on a specific menu item given an index.