ToolItem

#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.ToolItem.new_. Use gtk.container.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.

class ToolItem : Bin , Activatable {}

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this()

Creates a new #GtkToolItem

Members

Functions

connectCreateMenuProxy
gulong connectCreateMenuProxy(T callback, Flag!"After" after)

Connect to CreateMenuProxy signal.

connectToolbarReconfigured
gulong connectToolbarReconfigured(T callback, Flag!"After" after)

Connect to ToolbarReconfigured signal.

getEllipsizeMode
pango.types.EllipsizeMode getEllipsizeMode()

Returns the ellipsize mode used for tool_item. Custom subclasses of #GtkToolItem should call this function to find out how text should be ellipsized.

getExpand
bool getExpand()

Returns whether tool_item is allocated extra space. See gtk.tool_item.ToolItem.setExpand.

getHomogeneous
bool getHomogeneous()

Returns whether tool_item is the same size as other homogeneous items. See gtk.tool_item.ToolItem.setHomogeneous.

getIconSize
gtk.types.IconSize getIconSize()

Returns the icon size used for tool_item. Custom subclasses of #GtkToolItem should call this function to find out what size icons they should use.

getIsImportant
bool getIsImportant()

Returns whether tool_item is considered important. See gtk.tool_item.ToolItem.setIsImportant

getOrientation
gtk.types.Orientation getOrientation()

Returns the orientation used for tool_item. Custom subclasses of #GtkToolItem should call this function to find out what size icons they should use.

getProxyMenuItem
gtk.widget.Widget getProxyMenuItem(string menuItemId)

If menu_item_id matches the string passed to gtk.tool_item.ToolItem.setProxyMenuItem return the corresponding #GtkMenuItem.

getReliefStyle
gtk.types.ReliefStyle getReliefStyle()

Returns the relief style of tool_item. See gtk.button.Button.setRelief. Custom subclasses of #GtkToolItem should call this function in the handler of the #GtkToolItem::toolbar_reconfigured signal to find out the relief style of buttons.

getTextAlignment
float getTextAlignment()

Returns the text alignment used for tool_item. Custom subclasses of #GtkToolItem should call this function to find out how text should be aligned.

getTextOrientation
gtk.types.Orientation getTextOrientation()

Returns the text orientation used for tool_item. Custom subclasses of #GtkToolItem should call this function to find out how text should be orientated.

getTextSizeGroup
gtk.size_group.SizeGroup getTextSizeGroup()

Returns the size group used for labels in tool_item. Custom subclasses of #GtkToolItem should call this function and use the size group for labels.

getToolbarStyle
gtk.types.ToolbarStyle getToolbarStyle()

Returns 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

getUseDragWindow
bool getUseDragWindow()

Returns whether tool_item has a drag window. See gtk.tool_item.ToolItem.setUseDragWindow.

getVisibleHorizontal
bool getVisibleHorizontal()

Returns whether the tool_item is visible on toolbars that are docked horizontally.

getVisibleVertical
bool getVisibleVertical()

Returns whether tool_item is visible when the toolbar is docked vertically. See gtk.tool_item.ToolItem.setVisibleVertical.

rebuildMenu
void rebuildMenu()

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.

retrieveProxyMenuItem
gtk.widget.Widget retrieveProxyMenuItem()

Returns the #GtkMenuItem that was last set by gtk.tool_item.ToolItem.setProxyMenuItem, ie. the #GtkMenuItem that is going to appear in the overflow menu.

self
ToolItem self()

Returns this, for use in with statements.

setExpand
void setExpand(bool expand)

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.

setHomogeneous
void setHomogeneous(bool homogeneous)

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.

setIsImportant
void setIsImportant(bool isImportant)

Sets whether 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.types.ToolbarStyle.BothHoriz. The result is that only tool buttons with the “is_important” property set have labels, an effect known as “priority text”

setProxyMenuItem
void setProxyMenuItem(string menuItemId, gtk.widget.Widget menuItem)

Sets the #GtkMenuItem 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 gtk.tool_item.ToolItem.getProxyMenuItem.

setTooltipMarkup
void setTooltipMarkup(string markup)

Sets the markup text to be displayed as tooltip on the item. See gtk.widget.Widget.setTooltipMarkup.

setTooltipText
void setTooltipText(string text)

Sets the text to be displayed as tooltip on the item. See gtk.widget.Widget.setTooltipText.

setUseDragWindow
void setUseDragWindow(bool useDragWindow)

Sets whether tool_item has a drag window. When true the toolitem can be used as a drag source through gtk.widget.Widget.dragSourceSet. 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.

setVisibleHorizontal
void setVisibleHorizontal(bool visibleHorizontal)

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

setVisibleVertical
void setVisibleVertical(bool visibleVertical)

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.

toolbarReconfigured
void toolbarReconfigured()

Emits the signal #GtkToolItem::toolbar_reconfigured on tool_item. #GtkToolbar and other #GtkToolShell implementations use this function to notify children, when some aspect of their configuration changes.

Properties

_gType
GType _gType [@property getter]
isImportant
bool isImportant [@property getter]
isImportant
bool isImportant [@property setter]
visibleHorizontal
bool visibleHorizontal [@property getter]
visibleHorizontal
bool visibleHorizontal [@property setter]
visibleVertical
bool visibleVertical [@property getter]
visibleVertical
bool visibleVertical [@property setter]

Static functions

_getGType
GType _getGType()
builder
ToolItemGidBuilder builder()

Get builder for gtk.tool_item.ToolItem

Mixed In Members

From mixin ActivatableT!()

relatedAction
gtk.action.Action relatedAction [@property getter]

Get relatedAction property.

relatedAction
gtk.action.Action relatedAction [@property setter]

Set relatedAction property.

useActionAppearance
bool useActionAppearance [@property getter]

Get useActionAppearance property.

useActionAppearance
bool useActionAppearance [@property setter]

Set useActionAppearance property.

doSetRelatedAction
void doSetRelatedAction(gtk.action.Action action)

This is a utility function for #GtkActivatable implementors.

getRelatedAction
gtk.action.Action getRelatedAction()

Gets the related #GtkAction for activatable.

getUseActionAppearance
bool getUseActionAppearance()

Gets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance.

setRelatedAction
void setRelatedAction(gtk.action.Action action)

Sets the related action on the activatable object.

setUseActionAppearance
void setUseActionAppearance(bool useAppearance)

Sets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance

syncActionProperties
void syncActionProperties(gtk.action.Action action)

This is called to update the activatable completely, this is called internally when the #GtkActivatable:related-action property is set or unset and by the implementing class when #GtkActivatable:use-action-appearance changes.

Inherited Members

From Bin

_getGType
GType _getGType()
_gType
GType _gType [@property getter]
self
Bin self()

Returns this, for use in with statements.

builder
BinGidBuilder builder()

Get builder for gtk.bin.Bin

getChild
gtk.widget.Widget getChild()

Gets the child of the #GtkBin, or null if the bin contains no child widget. The returned widget does not have a reference added, so you do not need to unref it.

From Activatable

_getGType
GType _getGType()
relatedAction
gtk.action.Action relatedAction [@property getter]

Get relatedAction property.

relatedAction
gtk.action.Action relatedAction [@property setter]

Set relatedAction property.

useActionAppearance
bool useActionAppearance [@property getter]

Get useActionAppearance property.

useActionAppearance
bool useActionAppearance [@property setter]

Set useActionAppearance property.

doSetRelatedAction
void doSetRelatedAction(gtk.action.Action action)

This is a utility function for #GtkActivatable implementors.

getRelatedAction
gtk.action.Action getRelatedAction()

Gets the related #GtkAction for activatable.

getUseActionAppearance
bool getUseActionAppearance()

Gets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance.

setRelatedAction
void setRelatedAction(gtk.action.Action action)

Sets the related action on the activatable object.

setUseActionAppearance
void setUseActionAppearance(bool useAppearance)

Sets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance

syncActionProperties
void syncActionProperties(gtk.action.Action action)

This is called to update the activatable completely, this is called internally when the #GtkActivatable:related-action property is set or unset and by the implementing class when #GtkActivatable:use-action-appearance changes.