gtk.ToolItemthe base class of widgets
that can be added to gtk.Toolbar
(new in PyGTK 2.4)Synopsisgtk.ToolItemgtk.Bingtk.ToolItemset_homogeneoushomogeneousget_homogeneousset_expandexpandget_expandset_tooltiptooltipstip_textNonetip_privateNoneset_use_drag_windowuse_drag_windowget_use_drag_windowset_visible_horizontalvisible_horizontalget_visible_horizontalset_visible_verticalvisible_verticalget_visible_verticalset_is_importantis_importantget_is_importantget_icon_sizeget_orientationget_toolbar_styleget_relief_styleretrieve_proxy_menu_itemset_proxy_menu_itemmenu_item_idmenu_itemget_proxy_menu_itemmenu_item_idrebuild_menuset_tooltip_markupmarkupset_tooltip_texttexttoolbar_reconfiguredget_ellipsize_modeget_text_alignmentget_text_orientationget_text_size_groupAncestry+-- gobject.GObject
+-- gtk.Object
+-- gtk.Widget
+-- gtk.Container
+-- gtk.Bin
+-- gtk.ToolItem
Implemented Interfacesgtk.ToolItem
implements
gtk.Buildablegtk.ToolItem Propertiesgtk.Object Propertiesgtk.Widget Propertiesgtk.Container PropertiesThese properties are available in GTK+ 2.4 and above.
"is-important"Read-WriteIf True, the toolbar item is
considered important and the toolbar buttons show text in
gtk.TOOLBAR_BOTH_HORIZ mode. Default value:
False"visible-horizontal"Read-WriteIf True, the toolbar item is visible
when the toolbar is in a horizontal orientation. Default value:
True"visible-vertical"Read-WriteIf True, the toolbar item is visible
when the toolbar is in a vertical orientation. Default value:
True
gtk.ToolItem Style Propertiesgtk.Widget Style Propertiesgtk.ToolItem Signal Prototypesgobject.GObject Signal Prototypesgtk.Object Signal Prototypesgtk.Widget Signal Prototypesgtk.Container Signal Prototypes"create-menu-proxy"callbacktoolitemuser_param1..."set-tooltip"callbacktoolitemtooltipstip_texttip_privateuser_param1..."toolbar-reconfigured"callbacktoolitemuser_param1...DescriptionThis widget is available in PyGTK 2.4 and above.A gtk.ToolItem is a
widget that can appear on a gtk.Toolbar. To
create a toolbar item that contains something else than a button, use the
gtk.ToolItem() constructor
then use the gtk.Container.add()
method to add a child widget to the tool item.To create and use toolbar items that contain buttons, see the
gtk.ToolButton,
gtk.ToggleToolButton
and gtk.RadioToolButton
classes. See the gtk.Toolbar class
for a description of the toolbar widget.Constructorgtk.ToolItemReturns :the new gtk.ToolItemThis constructor is available in PyGTK 2.4 and above.Creates a new empty gtk.ToolItemMethodsgtk.ToolItem.set_homogeneousset_homogeneoushomogeneoushomogeneous :if True the tool item is the
same size as other homogeneous itemsThis method is available in PyGTK 2.4 and above.The set_homogeneous() method sets the
homogeneous setting of the tool item to the value of
homogeneous. If homogeneous is
True the 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.gtk.ToolItem.get_homogeneousget_homogeneousReturns :True if the item is the same
size as other homogeneous items.This method is available in PyGTK 2.4 and above.The get_homogeneous() method returns
the setting of the homogeneous setting of the tool item. If
True the tool item is the same size as other homogeneous
items. See the set_homogeneous()
method for more detail.gtk.ToolItem.set_expandset_expandexpandexpand :If True the tool item is
allocated extra space when availableThis method is available in PyGTK 2.4 and above.The set_expand() method sets the expand
setting of the tool item to the value of expand. If
expand is True the tool item is
allocated extra space when there is more room on the toolbar than needed for
the items. The effect is that the item gets bigger when the toolbar gets
bigger and smaller when the toolbar gets smaller.gtk.ToolItem.get_expandget_expandReturns :True if the tool item is
allocated extra space when available.This method is available in PyGTK 2.4 and above.The get_expand() method returns the
value of the expand setting of the tool item. If True the
tool item is allocated extra space. See the gtk.ToolItem.set_expand()
method for more detail.gtk.ToolItem.set_tooltipset_tooltiptooltipstip_textNonetip_privateNonetooltips :The gtk.Tooltips
object to be usedtip_text :the text to be used as tooltip text for the
tool item or Nonetip_private :the text to be used as private tooltip
text or NoneThis method is available in PyGTK 2.4 and above.The set_tooltip() method sets the gtk.Tooltips
object specified by tooltips to be used for the tool
item with the tooltip text specified by tip_text and
the private text specified by tip_private. See the
gtk.Tooltips.set_tip()
method for more information.gtk.ToolItem.set_use_drag_windowset_use_drag_windowuse_drag_windowuse_drag_window :if True the tool item has a
drag window.This method is available in PyGTK 2.4 and above.The set_use_drag_window() method
determines whether the tool item has a drag window according to the value of
use_drag_window. If
use_drag_window is True the
toolitem can be used as a drag source through the gtk.Widget.drag_source_set()
method. When the tool item has a drag window it will intercept all events,
even those that would otherwise be sent to a child of the tool itemgtk.ToolItem.get_use_drag_windowget_use_drag_windowReturns :True if the tool item uses a
drag window.This method is available in PyGTK 2.4 and above.The get_use_drag_window() returns the
setting that determines if the tool item has a drag window. See the set_use_drag_window()
for more information.gtk.ToolItem.set_visible_horizontalset_visible_horizontalvisible_horizontalvisible_horizontal :if True the tool item is
visible when in horizontal modeThis method is available in PyGTK 2.4 and above.The set_visible_horizontal() method
sets the "visible-horizontal" property to the value of
visible_horizontal. If
visible_horizontal is True, the
tool item is visible when the toolbar is docked horizontally.gtk.ToolItem.get_visible_horizontalget_visible_horizontalReturns :True if the tool item is
visible on toolbars that are docked
horizontally.This method is available in PyGTK 2.4 and above.The get_visible_horizontal() method
returns the value of the "visible-horizontal" property. If
"visible-horizontal" is True, the tool item is visible on
toolbars that are docked horizontally.gtk.ToolItem.set_visible_verticalset_visible_verticalvisible_verticalvisible_vertical :if True, the tool item is
visible when the toolbar is in vertical modeThis method is available in PyGTK 2.4 and above.The set_visible_vertical() method sets
the "visible-vertical" property to the value of
visible_vertical. If
visible_vertical is True, the 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 the tool item will not appear on toolbars that are
docked vertically.gtk.ToolItem.get_visible_verticalget_visible_verticalReturns :True if the tool item is visible when the
toolbar is docked verticallyThis method is available in PyGTK 2.4 and above.The get_visible_vertical() method
returns the value of the "visible-vertical" property. If "visible-vertical"
is True, the tool item is visible when the toolbar is
docked vertically. See the set_visible_vertical()
method for more information.gtk.ToolItem.set_is_importantset_is_importantis_importantis_important :if True, the tool item
should be considered importantThis method is available in PyGTK 2.4 and above.The set_is_important() method sets the
"is-important" property to the value of
is_important. If is_important
is True the tool item should be considered important. The
gtk.ToolButton
class uses this property to determine whether to show 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".gtk.ToolItem.get_is_importantget_is_importantReturns :True if the tool item is
considered important.This method is available in PyGTK 2.4 and above.The get_is_important() method returns
the value of the "is-important" property. If "is-important" is
True, the tool item is considered important. See the
set_is_important()
method for more information.gtk.ToolItem.get_icon_sizeget_icon_sizeReturns :the icon size used for the tool
itemThis method is available in PyGTK 2.4 and above.The get_icon_size() method returns the
icon size used for the tool item. Custom subclasses of gtk.ToolItem
should call this method to find out what size icons they should use. The
return value should be one of: gtk.ICON_SIZE_MENU,
gtk.ICON_SIZE_SMALL_TOOLBAR,
gtk.ICON_SIZE_LARGE_TOOLBAR,
gtk.ICON_SIZE_BUTTON,
gtk.ICON_SIZE_DND,
gtk.ICON_SIZE_DIALOG or an integer value returned from
the gtk.icon_size_register()
function.gtk.ToolItem.get_orientationget_orientationReturns :the orientation used for the tool
itemThis method is available in PyGTK 2.4 and above.The get_orientation() method returns
the orientation used for the tool item. Custom subclasses of gtk.ToolItem
should call this method to find out what size icons they should use. The
return value should be either gtk.ORIENTATION_HORIZONTAL
or gtk.ORIENTATION_VERTICAL.gtk.ToolItem.get_toolbar_styleget_toolbar_styleReturns :the toolbar style used for the tool
itemThis method is available in PyGTK 2.4 and above.The get_toolbar_style() method returns
the toolbar style used for the tool item. Custom subclasses of gtk.ToolItem
should call this method in the "toolbar-reconfigured"
signal handler 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 verticallygtk.TOOLBAR_ICONS, meaning the toolbar
shows only iconsgtk.TOOLBAR_TEXT, meaning the tool item
should only show textgtk.TOOLBAR_BOTH_HORIZ, meaning the tool
item should show both an icon and a label, arranged horizontally..gtk.ToolItem.get_relief_styleget_relief_styleReturns :the relief style used for the tool
itemThis method is available in PyGTK 2.4 and above.The get_relief_style() method returns
the relief style of the tool item. See the gtk.Button.set_relief()
method for more information. Custom subclasses of gtk.ToolItem
should call this method in the handler of the gtk.ToolItem
"toolbar-reconfigured"
signal to find out the relief style of buttons.The return value should be one of:
gtk.RELIEF_NORMAL, gtk.RELIEF_HALF or
gtk.RELIEF_NONE.gtk.ToolItem.retrieve_proxy_menu_itemretrieve_proxy_menu_itemReturns :The gtk.MenuItem that is going to appear in the
overflow menu for the tool itemThis method is available in PyGTK 2.4 and above.The retrieve_proxy_menu_item() method
returns the gtk.MenuItem that
was last set by the set_proxy_menu_item()
method, i.e. the gtk.MenuItem that
is going to appear in the overflow menu.gtk.ToolItem.set_proxy_menu_itemset_proxy_menu_itemmenu_item_idmenu_itemmenu_item_id :a string used to identify
menu_itemmenu_item :a gtk.MenuItem
to be used in the overflow menu or
NoneThis method is available in PyGTK 2.4 and above.The set_proxy_menu_item() method sets
the gtk.MenuItem
specified by menu_item to be used in the toolbar
overflow menu. menu_item_id is used to identify the
caller of this method and should also be used with the get_proxy_menu_item()
method. If menu_item is None the
tool item will not appear in the overflow menu.gtk.ToolItem.get_proxy_menu_itemget_proxy_menu_itemmenu_item_idmenu_item_id :a string used to identify the menu
itemReturns :The gtk.MenuItem
matching menu_item_id.This method is available in PyGTK 2.4 and above.The get_proxy_menu_item() method
returns the gtk.MenuItem
corresponding to the string specified by menu_item_id
as passed to the set_proxy_menu_item()
method.Custom subclasses of gtk.ToolItem
should use this method to update their menu item when the gtk.ToolItem
changes. Forcing a match with menu_item_id ensures
that a gtk.ToolItem will
not inadvertently change a menu item that they did not create.gtk.ToolItem.rebuild_menurebuild_menuThis method is available in PyGTK 2.6 and above.The rebuild_menu() method ignals to the
toolbar that the overflow menu item has changed. If the overflow menu is
visible when this method it called, the menu will be rebuilt. The method
must be called when the tool item changes what it will do in response to the
"create_menu_proxy" signal.gtk.ToolItem.set_tooltip_markupset_tooltip_markupmarkupmarkup :markup text to be used as tooltip.This method is available in PyGTK 2.12 and above.The set_tooltip_markup() method sets the
markup text to be displayed as tooltip on the item. See
gtk.Widget.set_tooltip_markup().gtk.ToolItem.set_tooltip_textset_tooltip_texttextmarkup :the text to be used as tooltip.This method is available in PyGTK 2.12 and above.The set_tooltip_text() method sets the
text to be displayed as tooltip on the item. See
gtk.Widget.set_tooltip_text().gtk.ToolItem.toolbar_reconfiguredtoolbar_reconfiguredThis method is available in PyGTK 2.14 and above.
The toolbar_reconfigured() method emits the signal
"toolbar-reconfigured"
on tool_item.
gtk.ToolBar
and other
gtk.ToolShell
implementations use this method to notify children, when some aspect of their configuration changes.
gtk.ToolItem.get_ellipsize_modeget_ellipsize_modeReturns :one of the
indicating how text should be ellipsized.This method is available in PyGTK 2.22 and above.The get_ellipsize_mode() method returns the ellipsize mode used
for the tool item. Custom subclasses of gtk.ToolItem
should call this method to find out how text should be ellipsized.gtk.ToolItem.get_text_alignmentget_text_alignmentReturns :the horizontal text alignment used for the tool item.This method is available in PyGTK 2.22 and above.The get_text_alignment() method returns the text alignment used
for the tool item. Custom subclasses of gtk.ToolItem
should call this method to find out how text should be aligned.gtk.ToolItem.get_text_orientationget_text_orientationReturns :the text orientation used for the tool item.This method is available in PyGTK 2.22 and above.The get_text_orientation() method returns the text orientation used
for the tool item. Custom subclasses of gtk.ToolItem
should call this method to find out how text should be orientated.gtk.ToolItem.get_text_size_groupget_text_size_groupReturns :a gtk.SizeGroup.This method is available in PyGTK 2.22 and above.The get_text_size_group() method returns the size group used for labels
in the tool item. Custom subclasses of gtk.ToolItem
should call this method and use the size group for labels.SignalsThe "create-menu-proxy" gtk.ToolItem Signalcallbacktoolitemuser_param1...toolitem :the toolitem that received the
signaluser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)Returns :True if the signal was
handledThis signal is available in GTK+ 2.4 and above.The "create-menu-proxy" signal is emitted when the toolbar is
displaying an overflow menu and is trying to determine if
toolitem should appear in the overflow menu. In
response toolitem should eithercall the set_proxy_menu_item()
method specifying menu_item as
None and return True to indicate that
the item should not appear in the overflow menucall the set_proxy_menu_item()
method with a new menu item and return True, orreturn 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.The toolbar may cache the result of this signal. When the tool
item changes how it will respond to this signal it must call the rebuild_menu())
method to invalidate the cache and ensure that the toolbar rebuilds its
overflow menu.The "set-tooltip" gtk.ToolItem Signalcallbacktoolitemtooltipstip_texttip_privateuser_param1...toolitem :the toolitem that received the
signaltooltips :the gtk.Tooltipstip_text :the tooltip texttip_private :the tooltip private textuser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)Returns :True if the signal was
handledThis signal is available in GTK+ 2.4 and above.The "set-tooltip" signal is emitted when the tool item's tooltip
changes. Application developers can use the set_tooltip()
method to set the item's tooltip.The "toolbar-reconfigured" gtk.ToolItem Signalcallbacktoolitemuser_param1...toolitem :the toolitem that received the
signaluser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)This signal is available in GTK+ 2.4 and above.The "toolbar-reconfigured" signal is emitted when some property
of the toolbar that the item is a child of changes. For custom subclasses of
gtk.ToolItem, the
default handler of this signal uses the methods:gtk.Toolbar.get_orientation()gtk.Toolbar.get_style()gtk.Toolbar.get_icon_size()gtk.Toolbar.get_relief_style()to find out what the toolbar should look like and change
themselves accordingly.