ToolButton

#GtkToolButtons are #GtkToolItems containing buttons.

Use gtk.tool_button.ToolButton.new_ to create a new #GtkToolButton.

The label of a #GtkToolButton is determined by the properties #GtkToolButton:label-widget, #GtkToolButton:label, and #GtkToolButton:stock-id. If #GtkToolButton:label-widget is non-null, then that widget is used as the label. Otherwise, if #GtkToolButton:label is non-null, that string is used as the label. Otherwise, if #GtkToolButton:stock-id is non-null, the label is determined by the stock item. Otherwise, the button does not have a label.

The icon of a #GtkToolButton is determined by the properties #GtkToolButton:icon-widget and #GtkToolButton:stock-id. If #GtkToolButton:icon-widget is non-null, then that widget is used as the icon. Otherwise, if #GtkToolButton:stock-id is non-null, the icon is determined by the stock item. Otherwise, the button does not have a icon.

CSS nodes

GtkToolButton has a single CSS node with name toolbutton.

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this(gtk.widget.Widget iconWidget, string label)

Creates a new #GtkToolButton using icon_widget as contents and label as label.

Members

Functions

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

Connect to Clicked signal.

getIconName
string getIconName()

Returns the name of the themed icon for the tool button, see gtk.tool_button.ToolButton.setIconName.

getIconWidget
gtk.widget.Widget getIconWidget()

Return the widget used as icon widget on button. See gtk.tool_button.ToolButton.setIconWidget.

getLabel
string getLabel()

Returns the label used by the tool button, or null 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.

getLabelWidget
gtk.widget.Widget getLabelWidget()

Returns the widget used as label on button. See gtk.tool_button.ToolButton.setLabelWidget.

getStockId
string getStockId()

Returns the name of the stock item. See gtk.tool_button.ToolButton.setStockId. The returned string is owned by GTK+ and must not be freed or modifed.

getUseUnderline
bool getUseUnderline()

Returns whether underscores in the label property are used as mnemonics on menu items on the overflow menu. See gtk.tool_button.ToolButton.setUseUnderline.

self
ToolButton self()

Returns this, for use in with statements.

setIconName
void setIconName(string iconName)

Sets the icon for the tool button from a named themed icon. See the docs for #GtkIconTheme for more details. The #GtkToolButton:icon-name property only has an effect if not overridden by non-null #GtkToolButton:label-widget, #GtkToolButton:icon-widget and #GtkToolButton:stock-id properties.

setIconWidget
void setIconWidget(gtk.widget.Widget iconWidget)

Sets icon as the widget used as icon on button. If icon_widget is null the icon is determined by the #GtkToolButton:stock-id property. If the #GtkToolButton:stock-id property is also null, button will not have an icon.

setLabel
void setLabel(string label)

Sets label as the label used for the tool button. The #GtkToolButton:label property only has an effect if not overridden by a non-null #GtkToolButton:label-widget property. If both the #GtkToolButton:label-widget and #GtkToolButton:label properties are null, the label is determined by the #GtkToolButton:stock-id property. If the #GtkToolButton:stock-id property is also null, button will not have a label.

setLabelWidget
void setLabelWidget(gtk.widget.Widget labelWidget)

Sets label_widget as the widget that will be used as the label for button. If label_widget is null the #GtkToolButton:label property is used as label. If #GtkToolButton:label is also null, the label in the stock item determined by the #GtkToolButton:stock-id property is used as label. If #GtkToolButton:stock-id is also null, button does not have a label.

setStockId
void setStockId(string stockId)

Sets the name of the stock item. See gtk.tool_button.ToolButton.newFromStock. The stock_id property only has an effect if not overridden by non-null #GtkToolButton:label-widget and #GtkToolButton:icon-widget properties.

setUseUnderline
void setUseUnderline(bool useUnderline)

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”.

Properties

_gType
GType _gType [@property getter]
iconName
string iconName [@property getter]

Get iconName property.

iconName
string iconName [@property setter]

Set iconName property.

iconWidget
gtk.widget.Widget iconWidget [@property getter]
iconWidget
gtk.widget.Widget iconWidget [@property setter]
label
string label [@property getter]
label
string label [@property setter]
labelWidget
gtk.widget.Widget labelWidget [@property getter]
labelWidget
gtk.widget.Widget labelWidget [@property setter]
stockId
string stockId [@property getter]
stockId
string stockId [@property setter]
useUnderline
bool useUnderline [@property getter]
useUnderline
bool useUnderline [@property setter]

Static functions

_getGType
GType _getGType()
builder
ToolButtonGidBuilder builder()

Get builder for gtk.tool_button.ToolButton

newFromStock
gtk.tool_button.ToolButton newFromStock(string stockId)

Creates a new #GtkToolButton containing the image and text from a stock item. Some stock ids have preprocessor macros like #GTK_STOCK_OK and #GTK_STOCK_APPLY.

Mixed In Members

From mixin ActionableT!()

actionName
string actionName [@property getter]
actionName
string actionName [@property setter]
actionTarget
glib.variant.Variant actionTarget [@property getter]
actionTarget
glib.variant.Variant actionTarget [@property setter]
getActionName
string getActionName()

Gets the action name for actionable.

getActionTargetValue
glib.variant.Variant getActionTargetValue()

Gets the current target value of actionable.

setActionName
void setActionName(string actionName)

Specifies the name of the action with which this widget should be associated. If action_name is null then the widget will be unassociated from any previous action.

setActionTargetValue
void setActionTargetValue(glib.variant.Variant targetValue)

Sets the target value of an actionable widget.

setDetailedActionName
void setDetailedActionName(string detailedActionName)

Sets the action-name and associated string target value of an actionable widget.

Inherited Members

From ToolItem

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

Returns this, for use in with statements.

builder
ToolItemGidBuilder builder()

Get builder for gtk.tool_item.ToolItem

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]
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.

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.

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

Connect to CreateMenuProxy signal.

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

Connect to ToolbarReconfigured signal.

From Actionable

_getGType
GType _getGType()
actionName
string actionName [@property getter]
actionName
string actionName [@property setter]
actionTarget
glib.variant.Variant actionTarget [@property getter]
actionTarget
glib.variant.Variant actionTarget [@property setter]
getActionName
string getActionName()

Gets the action name for actionable.

getActionTargetValue
glib.variant.Variant getActionTargetValue()

Gets the current target value of actionable.

setActionName
void setActionName(string actionName)

Specifies the name of the action with which this widget should be associated. If action_name is null then the widget will be unassociated from any previous action.

setActionTargetValue
void setActionTargetValue(glib.variant.Variant targetValue)

Sets the target value of an actionable widget.

setDetailedActionName
void setDetailedActionName(string detailedActionName)

Sets the action-name and associated string target value of an actionable widget.