Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Public Member Functions | Static Protected Attributes
Xfc::Gtk::MenuShell Class Reference

A GtkMenuShell C++ wrapper class. More...

#include <xfc/gtk/menushell.hh>

Inheritance diagram for Xfc::Gtk::MenuShell:
Xfc::Gtk::Container Xfc::Gtk::Widget Xfc::Gtk::Object Xfc::Atk::Implementor Xfc::G::Object Xfc::G::TypeInterface Xfc::G::TypeInstance Xfc::G::TypeInstance Xfc::Trackable Xfc::Trackable Xfc::Gtk::Menu Xfc::Gtk::MenuBar

List of all members.

Public Member Functions

Static Protected Attributes

Constructors


Detailed Description

A GtkMenuShell C++ wrapper class.

A MenuShell is the abstract base class used to derive the Menu and MenuBar subclasses. It is a container of MenuItem objects arranged in a list which can be navigated, selected, and activated by the user to perform application functions. A MenuItem can have a submenu associated with it, allowing for nested hierarchical menus.

See also: the Menu and MenuItem HOWTOs and example.


Constructor & Destructor Documentation

Xfc::Gtk::MenuShell::MenuShell ( GtkMenuShell *  menu_shell,
bool  owns_reference = false 
) [explicit, protected]

Construct a new MenuShell from an existing GtkMenuShell.

Parameters:
menu_shellA pointer to a GtkMenuShell.
owns_referenceSet false if the initial reference count is floating, set true if it's not.

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


Member Function Documentation

void Xfc::Gtk::MenuShell::activate_item ( MenuItem item,
bool  force_deactivate 
)

Activates the menu item within the menu shell.

Parameters:
itemThe menu item to activate.
force_deactivateIf true, force the deactivation of the menu shell after the menu item is activated.

Adds a new menu item to the end of the menu shell's item list.

Parameters:
itemThe menu item to add.
void Xfc::Gtk::MenuShell::append ( MenuItem item,
const sigc::slot< void > &  callback 
)

Adds a new menu item to the end of the menu shell's item list.

Parameters:
itemThe menu item to add.
callbackThe callback slot to connect to item's activate_signal.
void Xfc::Gtk::MenuShell::append ( MenuItem item,
const AccelKey accel_key,
const sigc::slot< void > &  callback 
)

Adds a new menu item to the end of the menu shell's item list.

Parameters:
itemThe menu item to add.
accel_keyThe accelerator key for the menu item.
callbackThe callback slot to connect to item's activate_signal.

Calls Gtk::Menu::get_accel_group() to retrieve the accelerator group for the menu, and adds the accelerator key to this accelerator group.

void Xfc::Gtk::MenuShell::append ( MenuItem item,
const AccelKey accel_key,
AccelGroup accel_group,
const sigc::slot< void > &  callback 
)

Adds a new menu item to the end of the menu shell's item list.

Parameters:
itemThe menu item to add.
accel_keyThe accelerator key for the menu item.
accel_groupThe accelerator group to add the accelerator key to.
callbackThe callback slot to connect to item's activate_signal.
void Xfc::Gtk::MenuShell::append ( const StockId stock_id,
const sigc::slot< void > &  callback 
)

Adds a new stock menu item to the end of the menu shell's item list.

Parameters:
stock_idThe stock ID of the menu item to append.
callbackThe callback slot to connect to the stock menu item's activate_signal.
bool Xfc::Gtk::MenuShell::children ( std::vector< MenuItem * > &  child_list) const

Get the list of MenuItem objects contained by this MenuShell.

Parameters:
child_listA reference to a vector of MenuItem* to hold the child list.
Returns:
true if the child list is not empty, and false if it is empty.

Deactivates the menu shell.

Typically this results in the menu shell being erased from the screen.

void Xfc::Gtk::MenuShell::insert ( MenuItem item,
int  position 
)

Adds a new menu item to the menu shell's item list at the position indicated by position.

Parameters:
itemThe menu item to add.
positionThe position in the item list where child is added (numbered from 0 to n-1).
void Xfc::Gtk::MenuShell::insert ( MenuItem item,
int  position,
const sigc::slot< void > &  callback 
)

Adds a new menu item to the menu shell's item list at the position indicated by position.

Parameters:
itemThe menu item to add.
positionThe position in the item list where child is added (numbered from 0 to n-1).
callbackThe callback slot to connect to item's activate_signal.
void Xfc::Gtk::MenuShell::insert ( MenuItem item,
int  position,
const AccelKey accel_key,
const sigc::slot< void > &  callback 
)

Adds a new menu item to the menu shell's item list at the position indicated by position.

Parameters:
itemThe menu item to add.
positionThe position in the item list where child is added (numbered from 0 to n-1).
accel_keyThe accelerator key for the menu item.
callbackThe callback slot to connect to item's activate_signal.

Calls Gtk::Menu::get_accel_group() to retrieve the accelerator group for the menu, and adds the accelerator key to this accelerator group.

void Xfc::Gtk::MenuShell::insert ( MenuItem item,
int  position,
const AccelKey accel_key,
AccelGroup accel_group,
const sigc::slot< void > &  callback 
)

Adds a new menu item to the menu shell's item list at the position indicated by position.

Parameters:
itemThe menu item to add.
positionThe position in the item list where child is added (numbered from 0 to n-1).
accel_keyThe accelerator key for the menu item.
accel_groupThe accelerator group to add the accelerator key to.
callbackThe callback slot to connect to item's activate_signal.
void Xfc::Gtk::MenuShell::insert ( const StockId stock_id,
int  position,
const sigc::slot< void > &  callback 
)

Adds a new stock menu item to the menu shell's item list at the position indicated by position.

Parameters:
stock_idThe stock ID of the menu item to insert.
positionThe position in the item list where child is added (numbered from 0 to n-1).
callbackThe callback slot to connect to the stock menu item's activate_signal.
void Xfc::Gtk::MenuShell::insert_separator ( int  position)

Adds a new separator menu item at the position indicated by position.

Parameters:
positionThe position in the item list where the separator is added (numbered from 0 to n-1).

Adds a new menu item to the beginning of the menu shell's item list.

Parameters:
itemThe menu item to add.
void Xfc::Gtk::MenuShell::prepend ( MenuItem item,
const sigc::slot< void > &  callback 
)

Adds a new menu item to the beginning of the menu shell's item list.

Parameters:
itemThe menu item to add.
callbackThe callback slot to connect to item's activate_signal.
void Xfc::Gtk::MenuShell::prepend ( MenuItem item,
const AccelKey accel_key,
const sigc::slot< void > &  callback 
)

Adds a new menu item to the beginning of the menu shell's item list.

Parameters:
itemThe menu item to add.
accel_keyThe accelerator key for the menu item.
callbackThe callback slot to connect to item's activate_signal.

Calls Gtk::Menu::get_accel_group() to retrieve the accelerator group for the menu, and adds the accelerator key to this accelerator group.

void Xfc::Gtk::MenuShell::prepend ( MenuItem item,
const AccelKey accel_key,
AccelGroup accel_group,
const sigc::slot< void > &  callback 
)

Adds a new menu item to the beginning of the menu shell's item list.

Parameters:
itemThe menu item to add.
accel_keyThe accelerator key for the menu item.
accel_groupThe accelerator group to add the accelerator key to.
callbackThe callback slot to connect to item's activate_signal.
void Xfc::Gtk::MenuShell::prepend ( const StockId stock_id,
const sigc::slot< void > &  callback 
)

Adds a new stock menu item to the beginning of the menu shell's item list.

Parameters:
stock_idThe stock ID of the menu item to prepend.
callbackThe callback slot to connect to the stock menu item's activate_signal.
void Xfc::Gtk::MenuShell::select_first ( bool  search_sensitive)

Select the first visible or selectable child of the menu shell; don't select tearoff items unless the only item is a tearoff item.

Parameters:
search_sensitiveIf true, search for the first selectable menu item, otherwise select nothing if the first item isn't sensitive.

search_sensitive should be false if the menu is being popped up initially.

Selects the menu item from the menu shell.

Parameters:
itemThe MenuItem to select.

Connect to the selection_done_signal; emitted when a selection has been completed within a menu shell.


Member Data Documentation

Deactivate signal (see signal_deactivate()).

Calls a slot with the signature:

< void function();
<

Selection done signal (see signal_selection_done()).

Calls a slot with the signature:

< void function();
<

The documentation for this class was generated from the following file:
Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC