Menu Methods
In addition to configure
and cget, the following methods
are defined for the Menu widget:
addAdds items to the end of a menu. The first argument is the type of menu item to add, and additional arguments are options to the menu item. For example:
$menu = $mainwindow->Menu; $menu->add( 'command', -label => "New", "-command" => \&newfile );
entrycgetGets information on a specific menu item given an index.
entryconfigureChanges information on a specific menu item given an index.
postDisplays the menu widget.
unpostRemoves the menu widget from display.
postcascadeUnposts a submenu and posts the cascade menu associated with the menu item at the specified index.
deleteRemoves menu items from the menu.
indexGiven a named index, returns the numerical index for that menu item.
insertInserts a menu item at the specified index. Same as
add, except that it takes an index as the first argument.invokeInvokes the menu item at the specified index as if it was selected.
typeReturns the type of menu item at the specified index.
ypositionReturns the y coordinate of the topmost pixel of the menu item.