gtkmm 2.4: Gtk::ToolButton Class Reference

Main Page Widgets Namespaces Book

# Gtk::ToolButton Class Reference
[Widgets]

Inheritance diagram for Gtk::ToolButton:
[legend]
List of all members.

## Detailed Description

A Gtk::ToolItem subclass that displays buttons.

A ToolButton is are Gtk::ToolItem containing a button.

## Public Member Functions
const Widget* | get_icon_widget () const
| Return the widget used as icon widget on button .
Widget* | get_icon_widget ()
| Return the widget used as icon widget on button .
Glib::ustring | get_label () const
| Returns the label used by the tool button, or `0` if the tool button doesn't have a label.
const Widget* | get_label_widget () const
| Returns the widget used as label on button .
Widget* | get_label_widget ()
| Returns the widget used as label on button .
Glib::ustring | get_stock_id () const
| Returns the name of the stock item.
bool | get_use_underline () const
| Returns whether underscores in the label property are used as mnemonics on menu items on the overflow menu.
const GtkToolButton* | gobj () const
| Provides access to the underlying C GtkObject.
GtkToolButton* | gobj ()
| Provides access to the underlying C GtkObject.
Glib::PropertyProxy_ReadOnly< Gtk::Widget > | property_icon_widget () const
| Icon widget to display in the item.
Glib::PropertyProxy<Gtk::Widget> | property_icon_widget ()
| Icon widget to display in the item.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_label () const
| Text to show in the item.
Glib::PropertyProxy<Glib::ustring> | property_label ()
| Text to show in the item.
Glib::PropertyProxy_ReadOnly< Gtk::Widget* > | property_label_widget () const
| Widget to use as the item label.
Glib::PropertyProxy<Gtk::Widget*> | property_label_widget ()
| Widget to use as the item label.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_stock_id () const
| The stock icon displayed on the item.
Glib::PropertyProxy<Glib::ustring> | property_stock_id ()
| The stock icon displayed on the item.
Glib::PropertyProxy_ReadOnly< bool > | property_use_underline () const
| If set.
Glib::PropertyProxy<bool> | property_use_underline ()
| If set.
void | set_icon_widget (Widget& icon_widget)
| Sets icon as the widget used as icon on button .
void | set_label (const Glib::ustring& label)
| Sets label as the label used for the tool button.
void | set_label_widget (Widget& label_widget)
| Sets label_widget as the widget that will be used as the label for button .
void | set_stock_id (const Gtk::StockID& stock_id)
| Sets the name of the stock item.
void | set_use_underline (bool use_underline=true)
| 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.
Glib::SignalProxy0<void> | signal_clicked ()
| This signal is emitted when the tool button is clicked with the mouse or activated with the keyboard.
| ToolButton (Widget& icon_widget, const Glib::ustring& label=Glib::ustring())
| Creates a new ToolButton with an image.
| ToolButton (const Glib::ustring& label)
| Creates a new ToolButton with a label.
| ToolButton (const Gtk::StockID& stock_id)
| Creates a new ToolButton from a StockID.
| ToolButton ()
| Creates a new ToolButton.
virtual | ~ToolButton ()
## Protected Member Functions
virtual void | on_clicked ()
## Related Functions
(Note that these are not member functions.)
Gtk::ToolButton* | wrap (GtkToolButton* object, bool take_copy=false)

## Constructor & Destructor Documentation

virtual Gtk::ToolButton::~ToolButton | ( |  | ) | `[virtual]`

Gtk::ToolButton::ToolButton | ( |  | ) |

| Creates a new ToolButton.

Gtk::ToolButton::ToolButton | ( | const Gtk::StockID& | stock_id | ) | `[explicit]`

  | Creates a new ToolButton from a StockID. The ToolButton will be created according to the stock_id properties. Parameters:
  | stock_id | The StockID which determines the look of the ToolButton.

Gtk::ToolButton::ToolButton | ( | const Glib::ustring& | label | ) | `[explicit]`

  | Creates a new ToolButton with a label. The ToolButton will have the label label. Parameters:
  | label | The string used to display the label for this ToolButton.

Gtk::ToolButton::ToolButton | ( | Widget& | icon_widget,
|  | const Glib::ustring& | label = `Glib::ustring()`
| ) | `[explicit]`

  | Creates a new ToolButton with an image. The ToolButton will have the label label and an image widget icon_widget. Parameters:
  | icon_widget | The widget placed as the ToolButton's icon.
  | label | The string used to display the label for this ToolButton.

## Member Function Documentation

const Widget* Gtk::ToolButton::get_icon_widget | ( |  | ) | const

| Return the widget used as icon widget on button . See set_icon_widget(). Returns: The widget used as icon on button , or `0`. Since: 2.4.

Widget* Gtk::ToolButton::get_icon_widget | ( |  | ) |

| Return the widget used as icon widget on button . See set_icon_widget(). Returns: The widget used as icon on button , or `0`. Since: 2.4.

Glib::ustring Gtk::ToolButton::get_label | ( |  | ) | const

| Returns the label used by the tool button, or `0` if the tool button doesn't have a label. or uses a the label from a stock item. The returned string is owned by GTK+, and must not be modified or freed. Returns: The label, or `0` Since: 2.4.

const Widget* Gtk::ToolButton::get_label_widget | ( |  | ) | const

| Returns the widget used as label on button . See set_label_widget(). Returns: The widget used as label on button , or `0`. Since: 2.4.

Widget* Gtk::ToolButton::get_label_widget | ( |  | ) |

| Returns the widget used as label on button . See set_label_widget(). Returns: The widget used as label on button , or `0`. Since: 2.4.

Glib::ustring Gtk::ToolButton::get_stock_id | ( |  | ) | const

| Returns the name of the stock item. See set_stock_id(). The returned string is owned by GTK+ and must not be freed or modifed. Returns: The name of the stock item for button . Since: 2.4.

bool Gtk::ToolButton::get_use_underline | ( |  | ) | const

| Returns 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 on menu items on the overflow menu. Since: 2.4.

const GtkToolButton* Gtk::ToolButton::gobj | ( |  | ) | const`[inline]`

| Provides access to the underlying C GtkObject. Reimplemented from Gtk::ToolItem. Reimplemented in Gtk::MenuToolButton, Gtk::RadioToolButton, and Gtk::ToggleToolButton.

GtkToolButton* Gtk::ToolButton::gobj | ( |  | ) | `[inline]`

| Provides access to the underlying C GtkObject. Reimplemented from Gtk::ToolItem. Reimplemented in Gtk::MenuToolButton, Gtk::RadioToolButton, and Gtk::ToggleToolButton.

virtual void Gtk::ToolButton::on_clicked | ( |  | ) | `[protected, virtual]`

Glib::PropertyProxy_ReadOnly<Gtk::Widget> Gtk::ToolButton::property_icon_widget | ( |  | ) | const

| Icon widget to display in the item. You rarely need to use properties because there are get_ and set_ methods for almost all of them. Returns: A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Gtk::Widget> Gtk::ToolButton::property_icon_widget | ( |  | ) |

| Icon widget to display in the item. You rarely need to use properties because there are get_ and set_ methods for almost all of them. Returns: A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gtk::ToolButton::property_label | ( |  | ) | const

| Text to show in the item. You rarely need to use properties because there are get_ and set_ methods for almost all of them. Returns: A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Glib::ustring> Gtk::ToolButton::property_label | ( |  | ) |

| Text to show in the item. You rarely need to use properties because there are get_ and set_ methods for almost all of them. Returns: A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Gtk::Widget*> Gtk::ToolButton::property_label_widget | ( |  | ) | const

| Widget to use as the item label. You rarely need to use properties because there are get_ and set_ methods for almost all of them. Returns: A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Gtk::Widget*> Gtk::ToolButton::property_label_widget | ( |  | ) |

| Widget to use as the item label. You rarely need to use properties because there are get_ and set_ methods for almost all of them. Returns: A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gtk::ToolButton::property_stock_id | ( |  | ) | const

| The stock icon displayed on the item. You rarely need to use properties because there are get_ and set_ methods for almost all of them. Returns: A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Glib::ustring> Gtk::ToolButton::property_stock_id | ( |  | ) |

| The stock icon displayed on the item. You rarely need to use properties because there are get_ and set_ methods for almost all of them. Returns: A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gtk::ToolButton::property_use_underline | ( |  | ) | const

| If set. You rarely need to use properties because there are get_ and set_ methods for almost all of them. Returns: A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::ToolButton::property_use_underline | ( |  | ) |

| If set. You rarely need to use properties because there are get_ and set_ methods for almost all of them. Returns: A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gtk::ToolButton::set_icon_widget | ( | Widget& | icon_widget | ) |

  | Sets icon as the widget used as icon on button . If icon_widget is `0` the icon is determined by the "stock_id" property. If the "stock_id" property is also `0`, button will not have an icon. Since: 2.4 Parameters:
  | icon_widget | The widget used as icon, or `0`.

void Gtk::ToolButton::set_label | ( | const Glib::ustring& | label | ) |

  | Sets label as the label used for the tool button. The "label" property only has an effect if not overridden by a non-`0` "label_widget" property. If both the "label_widget" and "label" properties are `0`, the label is determined by the "stock_id" property. If the "stock_id" property is also `0`, button will not have a label. Since: 2.4 Parameters:
  | label | A string that will be used as label, or `0`.

void Gtk::ToolButton::set_label_widget | ( | Widget& | label_widget | ) |

  | Sets label_widget as the widget that will be used as the label for button . If label_widget is `0` the "label" property is used as label. If "label" is also `0`, the label in the stock item determined by the "stock_id" property is used as label. If "stock_id" is also `0`, button does not have a label. Since: 2.4 Parameters:
  | label_widget | The widget used as label, or `0`.

void Gtk::ToolButton::set_stock_id | ( | const Gtk::StockID& | stock_id | ) |

  | Sets the name of the stock item. See the ToolButton::ToolButton(const Gtk::StockID& stock_id, IconSize size) constructor. The stock_id property only has an effect if not overridden by "label" and "icon_widget" properties. Since: 2.4 Parameters:
  | stock_id | A name of a stock item, or `0`.

void Gtk::ToolButton::set_use_underline | ( | bool | use_underline = `true` | ) |

  | 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. 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. Since: 2.4 Parameters:
  | use_underline | Whether the button label has the form "_Open".

Glib::SignalProxy0<void> Gtk::ToolButton::signal_clicked | ( |  | ) |

| This signal is emitted when the tool button is clicked with the mouse or activated with the keyboard.

## Friends And Related Function Documentation

Gtk::ToolButton* wrap | ( | GtkToolButton* | object,
|  | bool | take_copy = `false`
| ) | `[related]`

  | Parameters:
  | object | The C instance
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns: A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- toolbutton.h