The base class of widgets that can be added to GtkToolShell
Class GtkToolItem
GtkToolItems are widgets that can appear on a toolbar. To create a toolbar item that contain something else than a button, use gtk_tool_item_new(). Use gtk_container_add() to add a child widget to the tool item.
For toolbar items that contain buttons, see the GtkToolButton, GtkToggleToolButton and GtkRadioToolButton classes.
See the GtkToolbar class for a description of the toolbar widget, and GtkToolShell for a description of the tool shell interface.
Methods | |
get_ellipsize_mode | Returns the ellipsize mode used for tool_item. |
get_expand | Returns whether tool_item is allocated extra space. |
get_homogeneous | Returns whether tool_item is the same size as other homogeneous items. |
get_icon_size | Returns the icon size used for tool_item. |
get_is_important | Returns whether tool_item is considered important. |
get_orientation | Returns the orientation used for tool_item. |
get_relief_style | Returns the relief style of tool_item. |
get_text_alignment | Returns the text alignment used for tool_item. |
get_text_orientation | Returns the text orientation used for tool_item. |
get_toolbar_style | Returns the toolbar style used for tool_item. |
get_use_drag_window | Returns whether tool_item has a drag window. |
get_visible_horizontal | Returns whether the tool_item is visible on toolbars that are docked horizontally. |
get_visible_vertical | Returns whether tool_item is visible when the toolbar is docked vertically. |
rebuild_menu | Calling this function signals to the toolbar that the overflow menu item for tool_item has changed. |
retrieve_proxy_menu_item | Returns the GtkMenuItem that was last set by gtk_tool_item_set_proxy_menu_item(), ie. the GtkMenuItem that is going to appear in the overflow menu. |
set_expand | Sets whether tool_item is allocated extra space when there is more room on the toolbar then needed for the items. |
set_homogeneous | Sets whether tool_item is to be allocated the same size as other homogeneous items. |
set_is_important | Sets whether tool_item should be considered important. |
set_proxy_menu_item | Sets the GtkMenuItem used in the toolbar overflow menu. |
set_tooltip_markup | Sets the markup text to be displayed as tooltip on the item. |
set_tooltip_text | Sets the text to be displayed as tooltip on the item. |
set_use_drag_window | Sets whether tool_item has a drag window. |
set_visible_horizontal | Sets whether tool_item is visible when the toolbar is docked horizontally. |
set_visible_vertical | Sets whether tool_item is visible when the toolbar is docked vertically. |
toolbar_reconfigured | Emits the signal "toolbar_reconfigured" on tool_item. |
Returns the ellipsize mode used for tool_item.
GtkToolItem.get_ellipsize_mode()
Return | a PangoEllipsizeMode indicating how text in tool_item should be ellipsized. |
Custom subclasses of GtkToolItem should call this function to find out how text should be ellipsized.
Returns whether tool_item is allocated extra space.
GtkToolItem.get_expand()
Return | TRUE if tool_item is allocated extra space. |
Returns whether tool_item is the same size as other homogeneous items.
GtkToolItem.get_homogeneous()
Return | TRUE if the item is the same size as other homogeneous items. |
Returns the icon size used for tool_item.
GtkToolItem.get_icon_size()
Return | a GtkIconSize indicating the icon size used for tool_item. |
Custom subclasses of GtkToolItem should call this function to find out what size icons they should use.
Returns whether tool_item is considered important.
GtkToolItem.get_is_important()
Return | TRUE if tool_item is considered important. |
Returns the orientation used for tool_item.
GtkToolItem.get_orientation()
Return | a GtkOrientation indicating the orientation used for tool_item |
Custom subclasses of GtkToolItem should call this function to find out what size icons they should use.
Returns the relief style of tool_item.
GtkToolItem.get_relief_style()
Return | a GtkReliefStyle indicating the relief style used for tool_item. |
Custom subclasses of GtkToolItem should call this function in the handler of the "toolbar_reconfigured" signal to find out the relief style of buttons.
Returns the text alignment used for tool_item.
GtkToolItem.get_text_alignment()
Return | a numeric value indicating the horizontal text alignment used for tool_item |
Custom subclasses of GtkToolItem should call this function to find out how text should be aligned.
Returns the text orientation used for tool_item.
GtkToolItem.get_text_orientation()
Return | a GtkOrientation indicating the text orientation used for tool_item |
Custom subclasses of GtkToolItem should call this function to find out how text should be orientated.
Returns the toolbar style used for tool_item.
GtkToolItem.get_toolbar_style()
Return | A GtkToolbarStyle indicating the toolbar style used for tool_item. |
Custom subclasses of GtkToolItem should call this function in the handler of the GtkToolItem::toolbar_reconfigured signal to find out in what style the toolbar is displayed and change themselves accordingly
Possibilities are:
- GTK_TOOLBAR_BOTH, meaning the tool item should show both an icon and a label, stacked vertically
Returns whether tool_item has a drag window.
GtkToolItem.get_use_drag_window()
Return | TRUE if tool_item uses a drag window. |
Returns whether the tool_item is visible on toolbars that are docked horizontally.
GtkToolItem.get_visible_horizontal()
Return | TRUE if tool_item is visible on toolbars that are docked horizontally. |
Returns whether tool_item is visible when the toolbar is docked vertically.
GtkToolItem.get_visible_vertical()
Return | Whether tool_item is visible when the toolbar is docked vertically |
Calling this function signals to the toolbar that the overflow menu item for tool_item has changed.
GtkToolItem.rebuild_menu()
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.
Returns the GtkMenuItem that was last set by gtk_tool_item_set_proxy_menu_item(), ie. the GtkMenuItem that is going to appear in the overflow menu.
GtkToolItem.retrieve_proxy_menu_item()
Return | The GtkMenuItem that is going to appear in the overflow menu for tool_item. |
Sets whether tool_item is allocated extra space when there is more room on the toolbar then needed for the items.
GtkToolItem.set_expand( expand )
expand | Whether tool_item is allocated extra space |
The effect is that the item gets bigger when the toolbar gets bigger and smaller when the toolbar gets smaller.
Sets whether tool_item is to be allocated the same size as other homogeneous items.
GtkToolItem.set_homogeneous()
The effect is that all homogeneous items will have the same width as the widest of the items.
Sets whether tool_item should be considered important.
GtkToolItem.set_is_important( is_important )
is_important | whether the tool item should be considered important |
The GtkToolButton 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".
Sets the GtkMenuItem used in the toolbar overflow menu.
GtkToolItem.set_proxy_menu_item( menu_item_id, menu_item )
menu_item_id | a string used to identify menu_item |
menu_item | a GtkMenuItem to be used in the overflow menu |
The menu_item_id is used to identify the caller of this function and should also be used with gtk_tool_item_get_proxy_menu_item().
Sets the markup text to be displayed as tooltip on the item.
GtkToolItem.set_tooltip_markup( markup )
markup | markup text to be used as tooltip for tool_item |
Sets the text to be displayed as tooltip on the item.
GtkToolItem.set_tooltip_text( text )
text | text to be used as tooltip for tool_item |
Sets whether tool_item has a drag window.
GtkToolItem.set_use_drag_window( use_drag_window )
use_drag_window | Whether tool_item has a drag window. |
When TRUE the toolitem can be used as a drag source through gtk_drag_source_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.
Sets whether tool_item is visible when the toolbar is docked horizontally.
GtkToolItem.set_visible_horizontal( visible_horizontal )
visible_horizontal | Whether tool_item is visible when in horizontal mode |
Sets whether tool_item is visible when the toolbar is docked vertically.
GtkToolItem.set_visible_vertical( visible_vertical )
visible_vertical | whether tool_item is visible when the toolbar is in vertical mode |
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.
Emits the signal "toolbar_reconfigured" on tool_item.
GtkToolItem.toolbar_reconfigured()
GtkToolbar and other GtkToolShell implementations use this function to notify children, when some aspect of their configuration changes.