=head1 NAME

Gtk2::MenuItem

=cut

=for position DESCRIPTION

=head1 DESCRIPTION

If a MenuItem is created with a C<$label> string, or if the C<label>
property is set later, then it should be destroyed with
C<< $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 C<Gtk2::AccelLabel> back up to the item (the C<accel-widget>
property).

When a MenuItem is in a C<Gtk2::Menu> a C<destroy> happens
automatically.  Dropping the last ref to a Menu calls C<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
C<< $item->destroy >> explicitly.

=cut



=head1 HIERARCHY

  Glib::Object
  +----Glib::InitiallyUnowned
       +----Gtk2::Object
            +----Gtk2::Widget
                 +----Gtk2::Container
                      +----Gtk2::Bin
                           +----Gtk2::Item
                                +----Gtk2::MenuItem



=cut

=head1 INTERFACES

  Glib::Object::_Unregistered::AtkImplementorIface
  Gtk2::Buildable
  Gtk2::Activatable



=cut


=head1 METHODS

=head2 widget = Gtk2::MenuItem-E<gt>B<new> ($label=undef)

=over

=item * $label (string) 

=back

If a C<$label> argument is given then this is C<new_with_mnemonic>.

=head2 widget = Gtk2::MenuItem-E<gt>B<new_with_label> ($label=undef)

=over

=item * $label (string) 

=back

=head2 widget = Gtk2::MenuItem-E<gt>B<new_with_mnemonic> ($label=undef)

=over

=item * $label (string) 

=back

=head2 string = $menu_item-E<gt>B<get_accel_path> 

Since: gtk+ 2.14

=head2 $menu_item-E<gt>B<set_accel_path> ($accel_path)

=over

=item * $accel_path (string) 

=back

=head2 $menu_item-E<gt>B<activate> 

=head2 $menu_item-E<gt>B<deselect> 

=head2 string = $menu_item-E<gt>B<get_label> 

Since: gtk+ 2.16

=head2 $menu_item-E<gt>B<set_label> ($label)

=over

=item * $label (string) 

=back

Since: gtk+ 2.16

=head2 $menu_item-E<gt>B<remove_submenu> 

=head2 boolean = $menu_item-E<gt>B<get_right_justified> 

=head2 $menu_item-E<gt>B<set_right_justified> ($right_justified)

=over

=item * $right_justified (boolean) 

=back

=head2 $menu_item-E<gt>B<select> 

=head2 widget or undef = $menu_item-E<gt>B<get_submenu> 

=head2 $menu_item-E<gt>B<set_submenu> ($submenu)

=over

=item * $submenu (Gtk2::Widget or undef) 

=back

=head2 $menu_item-E<gt>B<toggle_size_allocate> ($allocation)

=over

=item * $allocation (integer) 

=back

=head2 requisition = $menu_item-E<gt>B<toggle_size_request> 

=head2 boolean = $menu_item-E<gt>B<get_use_underline> 

Since: gtk+ 2.16

=head2 $menu_item-E<gt>B<set_use_underline> ($use_underline)

=over

=item * $use_underline (boolean) 

=back

Since: gtk+ 2.16



=cut


=head1 PROPERTIES

=over

=item 'accel-path' (string : default undef : readable / writable / private)

Sets the accelerator path of the menu item

=item 'label' (string : default "" : readable / writable / private)

The text for the child label

=item 'right-justified' (boolean : default false : readable / writable / private)

Sets whether the menu item appears justified at the right side of a menu bar

=item 'submenu' (Gtk2::Menu : default undef : readable / writable / private)

The submenu attached to the menu item, or NULL if it has none

=item '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

=back



=cut


=head1 STYLE PROPERTIES

=over

=item 'arrow-scaling' (float : default 0.8 : readable / private)

Amount of space used up by arrow, relative to the menu item's font size

=item 'arrow-spacing' (integer : default 10 : readable / private)

Space between label and arrow

=item 'horizontal-padding' (integer : default 3 : readable / private)

Padding to left and right of the menu item

=item 'selected-shadow-type' (Gtk2::ShadowType : default "none" : readable / private)

Shadow type when item is selected

=item 'toggle-spacing' (integer : default 5 : readable / private)

Space between icon and label

=item 'width-chars' (integer : default 12 : readable / private)

The minimum desired width of the menu item in characters

=back



=cut


=head1 SIGNALS

=over

=item B<activate> (Gtk2::MenuItem)

=item B<activate-item> (Gtk2::MenuItem)

=item B<toggle-size-request> (Gtk2::MenuItem, gpointer)

=item B<toggle-size-allocate> (Gtk2::MenuItem, integer)

=back



=cut


=head1 SEE ALSO

L<Gtk2>, L<Glib::Object>, L<Glib::InitiallyUnowned>, L<Gtk2::Object>, L<Gtk2::Widget>, L<Gtk2::Container>, L<Gtk2::Bin>, L<Gtk2::Item>


=cut


=head1 COPYRIGHT

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL.  See L<Gtk2> for a full notice.



=cut

