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


Xfc::Gtk::ImageMenuItem Class Reference

A GtkImageMenuItem C++ wrapper class. More...

#include <xfc/gtk/imagemenuitem.hh>

Inheritance diagram for Xfc::Gtk::ImageMenuItem:

Xfc::Gtk::MenuItem Xfc::Gtk::Item Xfc::Gtk::Bin 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 List of all members.

Public Member Functions

Accessors
Methods

Detailed Description

A GtkImageMenuItem C++ wrapper class.

ImageMenuItem is a MenuItem widget that displays an image at the left side of the menu item text.


Constructor & Destructor Documentation

Xfc::Gtk::ImageMenuItem::ImageMenuItem ( GtkImageMenuItem *  menu_item,
bool  owns_reference = false 
) [explicit, protected]

Construct a new ImageMenuItem from an existing GtkImageMenuItem.

Parameters:
menu_item A pointer to a GtkImageMenuItem.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The menu_item can be a newly created GtkImageMenuItem or an existing GtkImageMenuItem (see G::Object::Object).

Xfc::Gtk::ImageMenuItem::ImageMenuItem ( const String label,
bool  use_underline = false 
) [explicit]

Constructs a new ImageMenuItem containing a label.

Parameters:
label The text of the menu item.
use_underline Set true if label contains a mnemonic character.
If characters in label are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the menu item.

Xfc::Gtk::ImageMenuItem::ImageMenuItem ( Widget image,
const String label,
bool  use_underline = false 
)

Constructs a new ImageMenuItem containing an image and a label.

Parameters:
image A widget to set as the image for the menu item.
label The text of the menu item.
use_underline Set true if label contains a mnemonic character.
If characters in label are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the menu item.

Xfc::Gtk::ImageMenuItem::ImageMenuItem ( Widget image,
const String label,
Menu submenu,
bool  use_underline = false 
)

Constructs a new ImageMenuItem that displays a submenu.

Parameters:
image A widget to set as the image for the menu item.
label The text of the menu item.
submenu The submenu under this menu item.
use_underline Set true if label contains a mnemonic character.
If characters in label are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the menu item.

Xfc::Gtk::ImageMenuItem::ImageMenuItem ( const StockId stock_id,
AccelGroup accel_group = 0 
) [explicit]

Create a new ImageMenuItem containing the image and text from a stock item.

Parameters:
stock_id The ID of the stock item.
accel_group The AccelGroup to add the menu items accelerator to, or null.
Some stock ids have preprocessor macros like Gtk::StockId::OK and Gtk::StockId::APPLY. If you want this menu item to have changeable accelerators, then pass in null for accel_group and call Gtk::MenuItem::set_accel_path() with an appropriate path for the menu item, then use Gtk::Stock::lookup() too look up the standard accelerator for the stock item and if one is found, call Gtk::AccelMap::add_entry() to register it.

Xfc::Gtk::ImageMenuItem::ImageMenuItem ( GtkImageMenuItem *  menu_item,
bool  owns_reference = false 
) [explicit, protected]

Construct a new ImageMenuItem from an existing GtkImageMenuItem.

Parameters:
menu_item A pointer to a GtkImageMenuItem.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The menu_item can be a newly created GtkImageMenuItem or an existing GtkImageMenuItem (see G::Object::Object).

Xfc::Gtk::ImageMenuItem::ImageMenuItem ( const String label,
bool  use_underline = false 
) [explicit]

Constructs a new ImageMenuItem containing a label.

Parameters:
label The text of the menu item.
use_underline Set true if label contains a mnemonic character.
If characters in label are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the menu item.

Xfc::Gtk::ImageMenuItem::ImageMenuItem ( Widget image,
const String label,
bool  use_underline = false 
)

Constructs a new ImageMenuItem containing an image and a label.

Parameters:
image A widget to set as the image for the menu item.
label The text of the menu item.
use_underline Set true if label contains a mnemonic character.
If characters in label are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the menu item.

Xfc::Gtk::ImageMenuItem::ImageMenuItem ( Widget image,
const String label,
Menu submenu,
bool  use_underline = false 
)

Constructs a new ImageMenuItem that displays a submenu.

Parameters:
image A widget to set as the image for the menu item.
label The text of the menu item.
submenu The submenu under this menu item.
use_underline Set true if label contains a mnemonic character.
If characters in label are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the menu item.

Xfc::Gtk::ImageMenuItem::ImageMenuItem ( const StockId stock_id,
AccelGroup accel_group = 0 
) [explicit]

Create a new ImageMenuItem containing the image and text from a stock item.

Parameters:
stock_id The ID of the stock item.
accel_group The AccelGroup to add the menu items accelerator to, or null.
Some stock ids have preprocessor macros like Gtk::StockId::OK and Gtk::StockId::APPLY. If you want this menu item to have changeable accelerators, then pass in null for accel_group and call Gtk::MenuItem::set_accel_path() with an appropriate path for the menu item, then use Gtk::Stock::lookup() too look up the standard accelerator for the stock item and if one is found, call Gtk::AccelMap::add_entry() to register it.


Member Function Documentation

void Xfc::Gtk::ImageMenuItem::set_image ( Widget image  ) 

Sets the image of ImageMenuItem to the given widget.

Parameters:
image A widget to set as the image for the menu item.

void Xfc::Gtk::ImageMenuItem::set_image ( const StockId stock_id  ) 

Sets the image of ImageMenuItem to the given stock icon.

Parameters:
stock_id The ID of the stock icon to set as the image for the menu item.


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