Main Page Widgets Namespaces Book

# Gtk::ToolItem Class Reference
[Widgets]

Inheritance diagram for Gtk::ToolItem:

[legend]

List of all members.

## Public Member Functions
bool | get_expand () const
| Return value: `true` if tool_item is allocated extra space.
bool | get_homogeneous () const
| Return value: `true` if the item is the same size as other homogeneous.
IconSize | get_icon_size () const
| Return value: a Gtk::IconSize indicating the icon size used for tool_item.
bool | get_is_important () const
| Return value: `true` if tool_item is considered important.
Orientation | get_orientation () const
| Return value: a Gtk::Orientation indicating the orientation.
const Widget* | get_proxy_menu_item (const Glib::ustring& menu_item_id) const
| If menu_item_id matches the string passed to set_proxy_menu_item() return the corresponding Gtk::MenuItem.
Widget* | get_proxy_menu_item (const Glib::ustring& menu_item_id)
| If menu_item_id matches the string passed to set_proxy_menu_item() return the corresponding Gtk::MenuItem.
ReliefStyle | get_relief_style () const
| Return value: a Gtk::ReliefStyle indicating the relief style used.
ToolbarStyle | get_toolbar_style () const
| Return value: A Gtk::ToolbarStyle indicating the toolbar style used.
bool | get_use_drag_window () const
| Return value: `true` if tool_item uses a drag window.
bool | get_visible_horizontal () const
| Return value: `true` if tool_item is visible on toolbars that are.
bool | get_visible_vertical () const
| Return value: Whether tool_item is visible when the toolbar is docked vertically.
const GtkToolItem* | gobj () const
| Provides access to the underlying C GtkObject.
GtkToolItem* | gobj ()
| Provides access to the underlying C GtkObject.
Glib::PropertyProxy_ReadOnly <bool> | property_is_important () const
| Whether the toolbar item is considered important.
Glib::PropertyProxy<bool> | property_is_important ()
| Whether the toolbar item is considered important.
Glib::PropertyProxy_ReadOnly <bool> | property_visible_horizontal () const
| Whether the toolbar item is visible when the toolbar is in a horizontal orientation.
Glib::PropertyProxy<bool> | property_visible_horizontal ()
| Whether the toolbar item is visible when the toolbar is in a horizontal orientation.
Glib::PropertyProxy_ReadOnly <bool> | property_visible_vertical () const
| Whether the toolbar item is visible when the toolbar is in a vertical orientation.
Glib::PropertyProxy<bool> | property_visible_vertical ()
| Whether the toolbar item is visible when the toolbar is in a vertical orientation.
void | rebuild_menu ()
| Calling this function signals to the toolbar that the overflow menu item for tool_item has changed.
const Widget* | retrieve_proxy_menu_item () const
| Return value: The Gtk::MenuItem that is going to appear in the.
Widget* | retrieve_proxy_menu_item ()
| Return value: The Gtk::MenuItem that is going to appear in the.
void | set_expand (bool expand=true)
| Sets whether tool_item is allocated extra space when there is more room on the toolbar then needed for the items.
void | set_homogeneous (bool homogeneous=true)
| Sets whether tool_item is to be allocated the same size as other homogeneous items.
void | set_is_important (bool is_important=true)
| Sets whether tool_item should be considered important.
void | set_proxy_menu_item (const Glib::ustring& menu_item_id, Widget& menu_item)
| Sets the Gtk::MenuItem used in the toolbar overflow menu.
void | set_tooltip (Tooltips& tooltips, const Glib::ustring& tip_text, const Glib::ustring& tip_private=Glib::ustring())
| Sets the Gtk::Tooltips object to be used for tool_item, the text to be displayed as tooltip on the item and the private text to be used.
void | set_tooltip_markup (const Glib::ustring& markup)
| Sets the markup text to be displayed as tooltip on the item.
void | set_tooltip_text (const Glib::ustring& text)
| Sets the text to be displayed as tooltip on the item.
void | set_use_drag_window (bool use_drag_window=true)
| Sets whether tool_item has a drag window.
void | set_visible_horizontal (bool visible_horizontal=true)
| Sets whether tool_item is visible when the toolbar is docked horizontally.
void | set_visible_vertical (bool visible_vertical=true)
| Sets whether tool_item is visible when the toolbar is docked vertically.
Glib::SignalProxy0<bool> | signal_create_menu_proxy ()
| This signal is emitted when the toolbar needs information from about whether the item should appear in the toolbar overflow menu.
Glib::SignalProxy3< bool, Tooltips*, const Glib::ustring &, const Glib::ustring& > | signal_set_tooltip ()
| This signal is emitted when the toolitem's tooltip changes.
Glib::SignalProxy0<void> | signal_toolbar_reconfigured ()
| This signal is emitted when some property of the toolbar that the item is a child of changes.
void | toolbar_reconfigured ()
| Emits the signal Gtk::ToolItem::toolbar_reconfigured on tool_item.
| ToolItem ()
virtual | ~ToolItem ()
## Protected Member Functions
virtual bool | on_create_menu_proxy ()
virtual void | on_toolbar_reconfigured ()
## Related Functions
(Note that these are not member functions.)
Gtk::ToolItem* | wrap (GtkToolItem* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Constructor & Destructor Documentation

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

Gtk::ToolItem::ToolItem | ( |  | ) |

## Member Function Documentation

bool Gtk::ToolItem::get_expand | ( |  | ) | const

Return value: `true` if tool_item is allocated extra space.

Returns:
  `true` if tool_item is allocated extra space.

Since gtkmm 2.4:

bool Gtk::ToolItem::get_homogeneous | ( |  | ) | const

Return value: `true` if the item is the same size as other homogeneous.

Returns:
  `true` if the item is the same size as other homogeneous item.s

Since gtkmm 2.4:

IconSize Gtk::ToolItem::get_icon_size | ( |  | ) | const

Return value: a Gtk::IconSize indicating the icon size used for tool_item.

Returns:
  A Gtk::IconSize indicating the icon size used for tool_item

Since gtkmm 2.4:

bool Gtk::ToolItem::get_is_important | ( |  | ) | const

Return value: `true` if tool_item is considered important.

Returns:
  `true` if tool_item is considered important.

Since gtkmm 2.4:

Orientation Gtk::ToolItem::get_orientation | ( |  | ) | const

Return value: a Gtk::Orientation indicating the orientation.

Returns:
  A Gtk::Orientation indicating the orientation used for tool_item

Since gtkmm 2.4:

const Widget* Gtk::ToolItem::get_proxy_menu_item | ( | const Glib::ustring & | menu_item_id | ) | const

If menu_item_id matches the string passed to set_proxy_menu_item() return the corresponding Gtk::MenuItem.

Custom subclasses of Gtk::ToolItem should use this function to update their menu item when the Gtk::ToolItem changes. That the menu_item_id<!-- -->s must match ensures that a Gtk::ToolItem will not inadvertently change a menu item that they did not create.

Parameters:

  | menu_item_id | A string used to identify the menu item.

Returns:
  The Gtk::MenuItem passed to set_proxy_menu_item(), if the menu_item_id<!-- -->s match.

Since gtkmm 2.4:

Widget* Gtk::ToolItem::get_proxy_menu_item | ( | const Glib::ustring & | menu_item_id | ) |

If menu_item_id matches the string passed to set_proxy_menu_item() return the corresponding Gtk::MenuItem.

Custom subclasses of Gtk::ToolItem should use this function to update their menu item when the Gtk::ToolItem changes. That the menu_item_id<!-- -->s must match ensures that a Gtk::ToolItem will not inadvertently change a menu item that they did not create.

Parameters:

  | menu_item_id | A string used to identify the menu item.

Returns:
  The Gtk::MenuItem passed to set_proxy_menu_item(), if the menu_item_id<!-- -->s match.

Since gtkmm 2.4:

ReliefStyle Gtk::ToolItem::get_relief_style | ( |  | ) | const

Return value: a Gtk::ReliefStyle indicating the relief style used.

Returns:
  A Gtk::ReliefStyle indicating the relief style used for tool_item.

Since gtkmm 2.4:

ToolbarStyle Gtk::ToolItem::get_toolbar_style | ( |  | ) | const

Return value: A Gtk::ToolbarStyle indicating the toolbar style used.

Returns:
  A Gtk::ToolbarStyle indicating the toolbar style used for tool_item.

Since gtkmm 2.4:

bool Gtk::ToolItem::get_use_drag_window | ( |  | ) | const

Return value: `true` if tool_item uses a drag window.

Returns:
  `true` if tool_item uses a drag window.

Since gtkmm 2.4:

bool Gtk::ToolItem::get_visible_horizontal | ( |  | ) | const

Return value: `true` if tool_item is visible on toolbars that are.

Returns:
  `true` if tool_item is visible on toolbars that are docked horizontally.

Since gtkmm 2.4:

bool Gtk::ToolItem::get_visible_vertical | ( |  | ) | const

Return value: Whether tool_item is visible when the toolbar is docked vertically.

Returns:
  Whether tool_item is visible when the toolbar is docked vertically

Since gtkmm 2.4:

const GtkToolItem* Gtk::ToolItem::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Bin.

Reimplemented in Gtk::MenuToolButton, Gtk::RadioToolButton, Gtk::SeparatorToolItem, Gtk::ToggleToolButton, and Gtk::ToolButton.

GtkToolItem* Gtk::ToolItem::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Bin.

Reimplemented in Gtk::MenuToolButton, Gtk::RadioToolButton, Gtk::SeparatorToolItem, Gtk::ToggleToolButton, and Gtk::ToolButton.

virtual bool Gtk::ToolItem::on_create_menu_proxy | ( |  | ) | `[protected, virtual]`

virtual void Gtk::ToolItem::on_toolbar_reconfigured | ( |  | ) | `[protected, virtual]`

Glib::PropertyProxy_ReadOnly<bool> Gtk::ToolItem::property_is_important | ( |  | ) | const

Whether the toolbar item is considered important.

When TRUE

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::ToolItem::property_is_important | ( |  | ) |

Whether the toolbar item is considered important.

When TRUE

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::ToolItem::property_visible_horizontal | ( |  | ) | const

Whether the toolbar item is visible when the toolbar is in a horizontal orientation.

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::ToolItem::property_visible_horizontal | ( |  | ) |

Whether the toolbar item is visible when the toolbar is in a horizontal orientation.

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::ToolItem::property_visible_vertical | ( |  | ) | const

Whether the toolbar item is visible when the toolbar is in a vertical orientation.

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::ToolItem::property_visible_vertical | ( |  | ) |

Whether the toolbar item is visible when the toolbar is in a vertical orientation.

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::ToolItem::rebuild_menu | ( |  | ) |

Calling this function signals to the toolbar that the overflow menu item for tool_item has changed.

If the overflow menu is visible when this function it called, the menu will be rebuilt.

The function must be called when the tool item changes what it will do in response to the "create_menu_proxy" signal.

Since gtkmm 2.6:

const Widget* Gtk::ToolItem::retrieve_proxy_menu_item | ( |  | ) | const

Return value: The Gtk::MenuItem that is going to appear in the.

Returns:
  The Gtk::MenuItem that is going to appear in the overflow menu for tool_item.

Since gtkmm 2.4:

Widget* Gtk::ToolItem::retrieve_proxy_menu_item | ( |  | ) |

Return value: The Gtk::MenuItem that is going to appear in the.

Returns:
  The Gtk::MenuItem that is going to appear in the overflow menu for tool_item.

Since gtkmm 2.4:

void Gtk::ToolItem::set_expand | ( | bool | expand = `true` | ) |

Sets whether tool_item is allocated extra space when there is more room on the toolbar then needed for the items.

The effect is that the item gets bigger when the toolbar gets bigger and smaller when the toolbar gets smaller.

Since gtkmm 2.4:

Parameters:

  | expand | Whether tool_item is allocated extra space.

void Gtk::ToolItem::set_homogeneous | ( | bool | homogeneous = `true` | ) |

Sets whether tool_item is to be allocated the same size as other homogeneous items.

The effect is that all homogeneous items will have the same width as the widest of the items.

Since gtkmm 2.4:

Parameters:

  | homogeneous | Whether tool_item is the same size as other homogeneous items.

void Gtk::ToolItem::set_is_important | ( | bool | is_important = `true` | ) |

Sets whether tool_item should be considered important.

The Gtk::ToolButton class uses this property to determine whether to show or hide its label when the toolbar style is Gtk::TOOLBAR_BOTH_HORIZ. The result is that only tool buttons with the "is_important" property set have labels, an effect known as "priority text"

Since gtkmm 2.4:

Parameters:

  | is_important | Whether the tool item should be considered important.

void Gtk::ToolItem::set_proxy_menu_item | ( | const Glib::ustring & | menu_item_id,
|  | Widget& | menu_item |
| ) |  |  |

Sets the Gtk::MenuItem used in the toolbar overflow menu.

The menu_item_id is used to identify the caller of this function and should also be used with get_proxy_menu_item().

Since gtkmm 2.4:

Parameters:

  | menu_item_id | A string used to identify menu_item.
  | menu_item | A Gtk::MenuItem to be used in the overflow menu.

void Gtk::ToolItem::set_tooltip | ( | Tooltips& | tooltips,
|  | const Glib::ustring & | tip_text,
|  | const Glib::ustring & | tip_private = `Glib::ustring()` |
| ) |  |  |

Sets the Gtk::Tooltips object to be used for tool_item, the text to be displayed as tooltip on the item and the private text to be used.

See Gtk::Tooltips::set_tip().

Since gtkmm 2.4:

Deprecated: 2.12: Use set_tooltip_text() instead.

Deprecated:
  Use set_tooltip_text() or set_tooltip_markup() instead

Parameters:

  | tooltips | The Gtk::Tooltips object to be used.
  | tip_text | Text to be used as tooltip text for tool_item.
  | tip_private | Text to be used as private tooltip text.

void Gtk::ToolItem::set_tooltip_markup | ( | const Glib::ustring & | markup | ) |

Sets the markup text to be displayed as tooltip on the item.

See Gtk::Widget::set_tooltip_markup().

Since gtkmm 2.12:

Parameters:

  | markup | Markup text to be used as tooltip for tool_item.

Reimplemented from Gtk::Widget.

void Gtk::ToolItem::set_tooltip_text | ( | const Glib::ustring & | text | ) |

Sets the text to be displayed as tooltip on the item.

See Gtk::Widget::set_tooltip_text().

Since gtkmm 2.12:

Parameters:

  | text | Text to be used as tooltip for tool_item.

Reimplemented from Gtk::Widget.

void Gtk::ToolItem::set_use_drag_window | ( | bool | use_drag_window = `true` | ) |

Sets whether tool_item has a drag window.

When `true` the toolitem can be used as a drag source through Gtk::DragSource::set(). When tool_item has a drag window it will intercept all events, even those that would otherwise be sent to a child of tool_item.

Since gtkmm 2.4:

Parameters:

  | use_drag_window | Whether tool_item has a drag window.

void Gtk::ToolItem::set_visible_horizontal | ( | bool | visible_horizontal = `true` | ) |

Sets whether tool_item is visible when the toolbar is docked horizontally.

Since gtkmm 2.4:

Parameters:

  | visible_horizontal | Whether tool_item is visible when in horizontal mode.

void Gtk::ToolItem::set_visible_vertical | ( | bool | visible_vertical = `true` | ) |

Sets whether tool_item is visible when the toolbar is docked vertically.

Some tool items, such as text entries, are too wide to be useful on a vertically docked toolbar. If visible_vertical is `false` tool_item will not appear on toolbars that are docked vertically.

Since gtkmm 2.4:

Parameters:

  | visible_vertical | Whether tool_item is visible when the toolbar is in vertical mode.

Glib::SignalProxy0< bool > Gtk::ToolItem::signal_create_menu_proxy | ( |  | ) |

This signal is emitted when the toolbar needs information from about whether the item should appear in the toolbar overflow menu.

In response the tool item should either <itemizedlist> <listitem> call set_proxy_menu_item() with a NULL pointer and return true to indicate that the item should not appear in the overflow menu </listitem> <listitem> call set_proxy_menu_item() with a new menu item and return true, or </listitem> <listitem> return false to indicate that the signal was not handled by the item. This means that the item will not appear in the overflow menu unless a later handler installs a menu item. </listitem> </itemizedlist>

The toolbar may cache the result of this signal. When the tool item changes how it will respond to this signal it must call rebuild_menu() to invalidate the cache and ensure that the toolbar rebuilds its overflow menu.

Returns:
  true if the signal was handled, false if not

Prototype:
  `bool on_my_create_menu_proxy()`

Glib::SignalProxy3<bool,Tooltips*,const Glib::ustring&,const Glib::ustring&> Gtk::ToolItem::signal_set_tooltip | ( |  | ) |

This signal is emitted when the toolitem's tooltip changes.

Application developers can use gtk_tool_item_set_tooltip() to set the item's tooltip.

Deprecated:
  : Use the new Gtk::Tooltip API. This signal will now never be emitted.

Parameters:

  | tooltips | the Tooltips
  | tip_text | the tooltip text
  | tip_private | the tooltip private text

Returns:
  true if the signal was handled, false if not.

Glib::SignalProxy0< void > Gtk::ToolItem::signal_toolbar_reconfigured | ( |  | ) |

This signal is emitted when some property of the toolbar that the item is a child of changes.

For custom subclasses of ToolItem, the default handler of this signal use the functions <itemizedlist> <listitem>Toolbar::get_orientation()</listitem> <listitem>Toolbar::get_style()</listitem> <listitem>Toolbar::get_icon_size()</listitem> <listitem>Toolbar::get_relief_style()</listitem> </itemizedlist> to find out what the toolbar should look like and change themselves accordingly.

Prototype:
  `void on_my_toolbar_reconfigured()`

void Gtk::ToolItem::toolbar_reconfigured | ( |  | ) |

Emits the signal Gtk::ToolItem::toolbar_reconfigured on tool_item.

Gtk::Toolbar and other Gtk::ToolShell implementations use this function to notify children, when some aspect of their configuration changes.

Since gtkmm 2.14:

## Friends And Related Function Documentation

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

A Glib::wrap() method for this object.

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:

- toolitem.h