Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Inti::Gtk::MenuItem Class Reference

A GtkMenuItem C++ wrapper class. More...

#include <inti/gtk/menuitem.h>

Inheritance diagram for Inti::Gtk::MenuItem:

Inti::Gtk::Item Inti::Gtk::Bin Inti::Gtk::Container Inti::Gtk::Widget Inti::Gtk::Object Inti::Atk::Implementor Inti::G::Object Inti::G::TypeInterface Inti::G::TypeInstance Inti::MemoryHandler Inti::G::TypeInstance Inti::ReferencedBase Inti::ReferencedBase Inti::Gtk::CheckMenuItem Inti::Gtk::ImageMenuItem Inti::Gtk::SeparatorMenuItem Inti::Gtk::TearoffMenuItem Inti::Gtk::RadioMenuItem Inti::Gtk::StockMenuItem List of all members.

Public Member Functions

Constructors
Accessors
Methods
Signal Proxies

Protected Member Functions

Contructors
Methods
Signal Handlers

Detailed Description

A GtkMenuItem C++ wrapper class.

The MenuItem widget and its derived widgets are the only valid child widgets for menus. Their function is to correctly handle highlighting, alignment, events and submenus. As MenuItem derives from Bin it can hold any valid child widget, although only a few are really useful.


Constructor & Destructor Documentation

Inti::Gtk::MenuItem::MenuItem GtkMenuItem *  menu_item,
bool  reference = false
[explicit, protected]
 

Construct a new MenuItem from an existing GtkMenuItem.

Parameters:
menu_item A pointer to a GtkMenuItem.
reference Set false if the initial reference count is floating, set true if it's not.

The menu_item can be a newly created GtkMenuItem or an existing GtkMenuItem (see G::Object::Object).

Inti::Gtk::MenuItem::MenuItem const String label,
bool  use_underline = false
[explicit]
 

Construct a new MenuItem whose child is a Label.

Parameters:
label The text for the label.
use_underline Set true if there is an underscore in front of the mnemonic character.

Inti::Gtk::MenuItem::MenuItem const String label,
Menu submenu,
bool  use_underline = false
 

Construct a new MenuItem that pops up a submenu.

Parameters:
label The text for the label.
submenu The submenu.
use_underline Set true if there is an underscore in front of the mnemonic character.


Member Function Documentation

void Inti::Gtk::MenuItem::add_label const String label,
bool  use_underline
[protected]
 

Adds a label widget to an empty menu item with the text label.

Parameters:
label The text for the label.
use_underline Set true if there is an underscore in front of the mnemonic character.

This method is used by the derived menu item widgets such as CheckMenuItem and ImageMenuItem. You probably wont find much use for it.

bool Inti::Gtk::MenuItem::get_right_justified  )  const
 

Gets whether the menu item appears justified at the right side of the menu bar.

Returns:
true if the menu item will appear at the far right if added to a menu bar.

Menu* Inti::Gtk::MenuItem::get_submenu  )  const
 

Gets the submenu underneath this menu item, if any (see set_submenu()).

Returns:
The submenu for this menu item, or null if there is none.

virtual void Inti::Gtk::MenuItem::on_activate_item  )  [protected, virtual]
 

Called when the menu item is activated, but also if the menu item has a submenu.

For normal applications, the relevant signal is "activate".

virtual void Inti::Gtk::MenuItem::on_toggle_size_allocate int  allocate  )  [protected, virtual]
 

Called when MenuBar or Menu allocates a size for the toggle.

Parameters:
allocate The size allocated to the toggle.

For CheckMenuItem the toggle is a checkbox. For ImageMenuItem the Toggle is an image.

virtual void Inti::Gtk::MenuItem::on_toggle_size_request int *  requisition  )  [protected, virtual]
 

Called when MenuBar or Menu requests the size of the toggle.

Parameters:
requisition The return location for the size of the toggle.

For CheckMenuItem the toggle is a checkbox. For ImageMenuItem the Toggle is an image.

void Inti::Gtk::MenuItem::set_accel_path const char *  accel_path  ) 
 

Set the accelerator path on the menu item, through which runtime changes of the menu item's accelerator caused by the user can be identified and saved to persistant storage (see Gtk::AccelMap::save() on this).

Parameters:
accel_path The accelerator path, corresponding to this menu item's functionality, or null to unset the current path.

To setup a default accelerator for this menu item, call Gtk::AccelMap::add_entry() with the same accel_path. See also Gtk::AccelMap::add_entry() on the specifics of accelerator paths, and Gtk::Menu::set_accel_path() for a more convenient variant of this function.

This Method is basically a convenience wrapper that handles calling Gtk::Widget::set_accel_path() with the appropriate accelerator group for the menu item. Note that you do need to set an accelerator group on the parent menu at construction or later with Gtk::Menu::set_accel_group() for this to work.

void Inti::Gtk::MenuItem::set_label const String label,
bool  use_underline = false
 

Sets the label text to label.

Parameters:
label The text for the label.
use_underline Set true if there is an underscore in front of the mnemonic character.

This method can be used to dynamically change the menu item text. If the menu item is empty, a label widget is added with the text label.

void Inti::Gtk::MenuItem::set_right_justified bool  right_justified  ) 
 

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

Parameters:
right_justified If true the menu item will appear at the far right if added to a menu bar.
This was traditionally done for "Help" menu items, but is now considered a bad idea. If the widget layout is reversed for a right-to-left language like Hebrew or Arabic, right-justified-menu-items appear at the left.

void Inti::Gtk::MenuItem::set_submenu Menu submenu  ) 
 

Sets the widget submenu, or changes it.

Parameters:
submenu The submenu.

const ActivateItemSignalProxy Inti::Gtk::MenuItem::sig_activate_item  )  [inline]
 

Connect to the activate_item_signal; emitted when the item is activated, but also if the menu item has a submenu.

For normal applications, the relevant signal is "activate".


The documentation for this class was generated from the following file: Main Page - Footer


Generated on Sun Sep 14 20:08:17 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002