Gtk-- Reference: Gtk::MenuItem

Class Index | Cross Index | Namespace Index

# Class Gtk::MenuItem

The widget used for item in menus.
Contained in: Gtk
Derived from: Gtk::Item
Derived by: Gtk::CheckMenuItem Gtk::TearoffMenuItem

#include <gtk--/menuitem.h>

### public function member index:
`` | `MenuItem` | `()`;
`` | `MenuItem` | `(`const` `string`& `label`, `gfloat` `x`=0.0, `gfloat` `y`=0.5)`;
``void`` | `accelerate` | `()`;
``emitable` `signal` `void`` | `activate` | `()`;
``signal` `void`` | `activate_item` | `()`;
``void`` | `configure` | `(`gint` `show_toggle_indicator`, `gint` `show_submenu_indicator`)`;
``Menu`*` | `get_submenu` | `() `const``;
``GtkMenuItem`*` | `gtkobj` | `()`;
``const` `GtkMenuItem`*` | `gtkobj` | `() `const``;
``bool`` | `has_submenu` | `()`;
``void`` | `hide_accel_label` | `()`;
``static` `bool`` | `isA` | `(`Object`* `object`)`;
``void`` | `remove_submenu` | `()`;
``void`` | `right_justify` | `()`;
``void`` | `set_placement` | `(`GtkSubmenuPlacement` `placement`)`;
``void`` | `set_submenu` | `(`Menu`& `submenu`)`;
``void`` | `show_accel_label` | `()`;
``virtual`` | `~MenuItem` | `()`;
### protected function member index:
``virtual` `void`` | `activate_impl` | `()`;
``virtual` `void`` | `activate_item_impl` | `()`;

## Description:

The `Gtk::MenuItem` widget and the derived widgets are the only valid childs for menus. Their function is to correctly handle highlighting, alignment, events and submenus.

As it derives from `Gtk::Bin` it can hold any valid child widget, altough only a few are really useful.

## Function Member Descriptions:

Gtk::MenuItem::MenuItem - create an empty menu item

`` `MenuItem``()`;
Gtk::MenuItem::MenuItem - create a menu item with label

`` `MenuItem``(`const` `string`& `label`, `gfloat` `x`=0.0, `gfloat` `y`=0.5)`;
Gtk::MenuItem::gtkobj - Returns the underlaying gtk+ object.

``GtkMenuItem`*` `gtkobj``()`;
Gtk::MenuItem::isA - Returns true if object is this type.

``static` `bool`` `isA``(`Object`* `object`)`;
Gtk::MenuItem::remove_submenu - Remove the item's attached submenu

``void`` `remove_submenu``()`;
Gtk::MenuItem::set_submenu - Make this item a cascading menu

``void`` `set_submenu``(`Menu`& `submenu`)`;

## Variable Member Descriptions: