GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

GFC::Gtk::ToolButton Class Reference

A GtkToolButton C++ wrapper class. More...

#include <gfc/gtk/toolbutton.hh>

Inheritance diagram for GFC::Gtk::ToolButton:

GFC::Gtk::ToolItem GFC::Gtk::Bin GFC::Gtk::Container GFC::Gtk::Widget GFC::Gtk::Object GFC::Atk::Implementor GFC::G::Object GFC::G::TypeInterface GFC::G::TypeInstance GFC::G::TypeInstance GFC::Trackable GFC::Trackable GFC::Gtk::ToggleToolButton GFC::Gtk::RadioToolButton List of all members.

Signal Prototypes

Public Member Functions

Constructors
Accessors
Methods
Signal Proxies

Protected Member Functions

Constructors

Detailed Description

A GtkToolButton C++ wrapper class.

ToolButton is a ToolItem that contains a button. A ToolButton can be constructed using a custom icon widget or a stock item.

The label of a ToolButton is determined by the properties "label_widget", "label", and "stock_id". If "label_widget" is set, then that widget is used as the label. Otherwise, if "label" is set, that string is used as the label. Otherwise, if "stock_id" is set, the label is determined by the stock item. Otherwise, the button does not have a label.

The icon of a ToolButton is determined by the properties "icon_widget" and "stock_id". If "icon_widget" is set, then that widget is used as the icon. Otherwise, if "stock_id" is set, the icon is determined by the stock item. Otherwise, the button does not have an icon.


Constructor & Destructor Documentation

GFC::Gtk::ToolButton::ToolButton GtkToolButton *  tool_button,
bool  owns_reference = false
[explicit, protected]
 

Construct a new ToolButton from an existing GtkToolButton.

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

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

GFC::Gtk::ToolButton::ToolButton Widget icon_widget  ) 
 

Constructs a new tool button using icon_widget as the icon.

Parameters:
icon_widget A widget that will be used as the icon widget.

GFC::Gtk::ToolButton::ToolButton const String label,
bool  use_underline = false
 

Constructs a new tool button using label as the label.

Parameters:
label A string that will be used as the label.
use_underline Whether the button label has the mnemonic form "_Open".

GFC::Gtk::ToolButton::ToolButton Widget icon_widget,
const String label,
bool  use_underline = false
 

Constructs a new tool button using icon_widget as the icon and label as the label.

Parameters:
icon_widget A widget that will be used as the icon widget.
label A string that will be used as the label.
use_underline Whether the button label has the mnemonic form "_Open".

GFC::Gtk::ToolButton::ToolButton const StockId stock_id  ) 
 

Constructs a new tool button containing the image and text from a stock item.

Parameters:
stock_id The ID of the stock item (see set_stock_id()).

It is an error if stock_id is not a name of a stock item.


Member Function Documentation

Widget* GFC::Gtk::ToolButton::get_icon_widget  )  const
 

Gets the widget used as the icon widget the button, or null.

Returns:
The widget used as the icon on the button, or null.

String GFC::Gtk::ToolButton::get_label  )  const
 

Gets the label used by the tool button, or a null String if the tool button doesn't have a label, or uses the label from a stock item.

Returns:
The label, or a null String.

Widget* GFC::Gtk::ToolButton::get_label_widget  )  const
 

Gets the the widget used as label on the button (see set_label_widget()).

Returns:
The widget used as the label on the button, or null.

String GFC::Gtk::ToolButton::get_stock_id  )  const
 

Determines the ID of the stock item (see set_stock_id()).

Returns:
The ID of the stock item for the button.

bool GFC::Gtk::ToolButton::get_use_underline  )  const
 

Determines whether underscores in the label property are used as mnemonics on menu items on the overflow menu (see set_use_underline()).

Returns:
true if underscores in the label property are used as mnemonics.

void GFC::Gtk::ToolButton::set_contents Widget icon_widget,
const String label,
bool  use_underline = false
 

Sets icon_widget as the widget used as the icon and label as the label used for the tool button.

Parameters:
icon_widget The widget used as the icon.
label A string that will be used as label, or null.
use_underline Whether the button label has the mnemonic form "_Open"

This convenience method is equivalent to calling set_icon_widget() and set_label() separately. It also calls show() on the icon_widget.

void GFC::Gtk::ToolButton::set_icon_widget Widget icon_widget  ) 
 

Sets icon_widget as the widget used as the icon on the button.

Parameters:
icon_widget The widget used as the icon, or null.

If icon_widget is null the icon is determined by the 'stock_id' property. If the 'stock_id' property is also null, the button will not have an icon.

void GFC::Gtk::ToolButton::set_label const String label,
bool  use_underline = false
 

Sets label as the label used for the tool button.

Parameters:
label A string that will be used as label, or null.
use_underline Whether the button label has the mnemonic form "_Open"

This method sets the 'label' property. The label property only has an effect if not overridden by a non-null 'label_widget' property. If both the 'label_widget' and 'label' properties are null, the label is determined by the 'stock_id' property. If the 'stock_id' property is also null, the button will not have a label.

void GFC::Gtk::ToolButton::set_label_widget Widget label_widget  ) 
 

Sets label_widget as the widget used as the label for the button.

Parameters:
label_widget The widget used as the label, or null.

If label_widget is null the 'label' property is used as the label. If 'label' is also null, the label in the stock item determined by the 'stock_id' property is used as the label. If 'stock_id' is also null, the button does not have a label.

void GFC::Gtk::ToolButton::set_stock_id const StockId stock_id  ) 
 

Sets the ID of the stock item.

Parameters:
stock_id The ID of the stock item (such as Gtk::Stock::OK and Gtk::Stock::APPLY).

The 'stock_id' property only has an effect if not overridden by non-null 'label' and 'icon_widget' properties.

void GFC::Gtk::ToolButton::set_use_underline bool  use_underline  ) 
 

If set, an underline in the label property indicates that the next character should be used for the mnemonic accelerator key in the overflow menu.

Parameters:
use_underline Whether the button label has the mnemonic form "_Open"

For example, if the label property is "_Open" and use_underline is true, the label on the tool button will be "Open" and the item on the overflow menu will have an underlined 'O'.

Labels shown on tool buttons never have mnemonics on them; this property only affects the menu item on the overflow menu.


Member Data Documentation

const ClickedSignalType GFC::Gtk::ToolButton::clicked_signal [static, protected]
 

Clicked signal (see sig_clicked()).

Calls a slot with the signature:

             void function();


The documentation for this class was generated from the following file:
Generated on Tue Aug 24 00:34:43 2004 for GFC-UI by doxygen 1.3.8