Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tk::menu::item(3) [centos man page]

Menu::Item(3)						User Contributed Perl Documentation					     Menu::Item(3)

NAME
Tk::Menu::Item - Base class for Menu items SYNOPSIS
require Tk::Menu::Item; my $but = $menu->Button(...); $but->configure(...); my $what = $but->cget(); package Whatever; require Tk::Menu::Item; @ISA = qw(Tk::Menu::Item); sub PreInit { my ($class,$menu,$info) = @_; $info->{'-xxxxx'} = ... my $y = delete $info->{'-yyyy'}; } DESCRIPTION
Tk::Menu::Item is the base class from which Tk::Menu::Button, Tk::Menu::Cascade, Tk::Menu::Radiobutton and Tk::Menu::Checkbutton are derived. There is also a Tk::Menu::Separator. Constructors are declared so that $menu->Button(...) etc. do what you would expect. The "-label" option is pre-processed allowing ~ to be prefixed to the character to derive a "-underline" value. Thus $menu->Button(-label => 'Goto ~Home',...) is equivalent to $menu->Button(-label => 'Goto Home', -underline => 6, ...) The "Cascade" menu item creates a sub-menu and accepts these options: -menuitems A list of items for the sub-menu. Within this list (which is also accepted by Menu and Menubutton) the first two elements of each item should be the "constructor" name and the label: -menuitems => [ [Button => '~Quit', -command => [destroy => $mw]], [Checkbutton => '~Oil', -variable => $oil], ] -postcommand A callback to be invoked before posting the menu. -tearoff Specifies whether sub-menu can be torn-off or not. -menuvar Scalar reference that will be set to the newly-created sub-menu. The returned object is currently a blessed reference to an array of two items: the containing Menu and the 'label'. Methods "configure" and "cget" are mapped onto underlying "entryconfigure" and "entrycget". The main purpose of the OO interface is to allow derived item classes to be defined which pre-set the options used to create a more basic item. BUGS
This OO interface is very new. Using the label as the "key" is a problem for separaror items which don't have one. The alternative would be to use an index into the menu but that is a problem if items are deleted (or inserted other than at the end). There should probably be a PostInit entry point too, or a more widget like defered 'configure'. perl v5.16.3 2014-06-10 Menu::Item(3)

Check Out this Related Man Page

Gtk2::MenuItem(3pm)					User Contributed Perl Documentation				       Gtk2::MenuItem(3pm)

NAME
Gtk2::MenuItem - wrapper for GtkMenuItem DESCRIPTION
If a MenuItem is created with a $label string, or if the "label" property is set later, then it should be destroyed with "$item->destroy". Just dropping the last Perl ref is not enough because (as of Gtk through to 2.18) there's a circular reference from the child "Gtk2::AccelLabel" back up to the item (the "accel-widget" property). When a MenuItem is in a "Gtk2::Menu" a "destroy" happens automatically. Dropping the last ref to a Menu calls "destroy" on its children, as usual for a container. But if you remove a MenuItem with a label from a menu (or never add it to one) then be sure to "$item->destroy" explicitly. HIERARCHY
Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gtk2::Widget +----Gtk2::Container +----Gtk2::Bin +----Gtk2::Item +----Gtk2::MenuItem INTERFACES
Glib::Object::_Unregistered::AtkImplementorIface Gtk2::Buildable Gtk2::Activatable METHODS
widget = Gtk2::MenuItem->new ($label=undef) o $label (string) If a $label argument is given then this is "new_with_mnemonic". widget = Gtk2::MenuItem->new_with_label ($label=undef) o $label (string) widget = Gtk2::MenuItem->new_with_mnemonic ($label=undef) o $label (string) string = $menu_item->get_accel_path Since: gtk+ 2.14 $menu_item->set_accel_path ($accel_path) o $accel_path (string) $menu_item->activate $menu_item->deselect string = $menu_item->get_label Since: gtk+ 2.16 $menu_item->set_label ($label) o $label (string) Since: gtk+ 2.16 $menu_item->remove_submenu boolean = $menu_item->get_right_justified $menu_item->set_right_justified ($right_justified) o $right_justified (boolean) $menu_item->select widget or undef = $menu_item->get_submenu $menu_item->set_submenu ($submenu) o $submenu (Gtk2::Widget or undef) $menu_item->toggle_size_allocate ($allocation) o $allocation (integer) requisition = $menu_item->toggle_size_request boolean = $menu_item->get_use_underline Since: gtk+ 2.16 $menu_item->set_use_underline ($use_underline) o $use_underline (boolean) Since: gtk+ 2.16 PROPERTIES
'accel-path' (string : default undef : readable / writable / private) Sets the accelerator path of the menu item 'label' (string : default "" : readable / writable / private) The text for the child label 'right-justified' (boolean : default false : readable / writable / private) Sets whether the menu item appears justified at the right side of a menu bar 'submenu' (Gtk2::Menu : default undef : readable / writable / private) The submenu attached to the menu item, or NULL if it has none 'use-underline' (boolean : default false : readable / writable / private) If set, an underline in the text indicates the next character should be used for the mnemonic accelerator key STYLE PROPERTIES
'arrow-scaling' (float : default 0.8 : readable / private) Amount of space used up by arrow, relative to the menu item's font size 'arrow-spacing' (integer : default 10 : readable / private) Space between label and arrow 'horizontal-padding' (integer : default 3 : readable / private) Padding to left and right of the menu item 'selected-shadow-type' (Gtk2::ShadowType : default "none" : readable / private) Shadow type when item is selected 'toggle-spacing' (integer : default 5 : readable / private) Space between icon and label 'width-chars' (integer : default 12 : readable / private) The minimum desired width of the menu item in characters SIGNALS
activate (Gtk2::MenuItem) activate-item (Gtk2::MenuItem) toggle-size-request (Gtk2::MenuItem, gpointer) toggle-size-allocate (Gtk2::MenuItem, integer) SEE ALSO
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Bin, Gtk2::Item COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.14.2 2012-05-27 Gtk2::MenuItem(3pm)
Man Page