ToolButton

GtkToolButtons are GtkToolItems containing buttons.

Use gtk_tool_button_new() to create a new GtkToolButton.

The label of a GtkToolButton is determined by the properties "label-widget", "label", and "stock-id". If "label-widget" is non-NULL, then that widget is used as the label. Otherwise, if "label" is non-NULL, that string is used as the label. Otherwise, if "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 "icon-widget" and "stock-id". If "icon-widget" is non-NULL, then that widget is used as the icon. Otherwise, if "stock-id" is non-NULL, the icon is determined by the stock item. Otherwise, the button does not have a icon.

Constructors

this
this(GtkToolButton* gtkToolButton)

Sets our main struct and passes it to the parent class

this
this(StockID stockID)
this
this(Widget iconWidget, string label)

Creates a new GtkToolButton using icon_widget as contents and label as label. Since 2.4

this
this(string stockId)

Warning gtk_tool_button_new_from_stock has been deprecated since version 3.10 and should not be used in newly-written code. Use gtk_tool_button_new() instead. 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. It is an error if stock_id is not a name of a stock item. Since 2.4

Members

Functions

addOnClicked
void addOnClicked(void delegate(ToolButton) dlg, ConnectFlags connectFlags)

This signal is emitted when the tool button is clicked with the mouse or activated with the keyboard. See Also GtkToolbar, GtkMenuToolButton, GtkToggleToolButton, GtkRadioToolButton, GtkSeparatorToolItem

getIconName
string getIconName()

Returns the name of the themed icon for the tool button, see gtk_tool_button_set_icon_name(). Since 2.8

getIconWidget
Widget getIconWidget()

Return the widget used as icon widget on button. See gtk_tool_button_set_icon_widget(). Since 2.4

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. Since 2.4

getLabelWidget
Widget getLabelWidget()

Returns the widget used as label on button. See gtk_tool_button_set_label_widget(). Since 2.4

getStockId
string getStockId()

Warning gtk_tool_button_get_stock_id has been deprecated since version 3.10 and should not be used in newly-written code. Use gtk_tool_button_get_icon_name() instead. Returns the name of the stock item. See gtk_tool_button_set_stock_id(). The returned string is owned by GTK+ and must not be freed or modifed. Since 2.4

getStruct
void* getStruct()

the main Gtk struct as a void*

getToolButtonStruct
GtkToolButton* getToolButtonStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getUseUnderline
int getUseUnderline()

Returns whether underscores in the label property are used as mnemonics on menu items on the overflow menu. See gtk_tool_button_set_use_underline(). Since 2.4

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 "icon_name" property only has an effect if not overridden by non-NULL "label", "icon_widget" and "stock_id" properties. Since 2.8

setIconWidget
void setIconWidget(Widget iconWidget)

Sets icon as the widget used as icon on button. If icon_widget is NULL the icon is determined by the "stock_id" property. If the "stock_id" property is also NULL, button will not have an icon. Since 2.4

setLabel
void setLabel(string label)

Sets label as the label used for the tool button. The "label" property only has an effect if not overridden by a non-NULL "label_widget" property. If both the "label_widget" and "label" properties are NULL, the label is determined by the "stock_id" property. If the "stock_id" property is also NULL, button will not have a label. Since 2.4

setLabelWidget
void setLabelWidget(Widget labelWidget)

Sets label_widget as the widget that will be used as the label for button. If label_widget is NULL the "label" property is used as label. If "label" is also NULL, the label in the stock item determined by the "stock_id" property is used as label. If "stock_id" is also NULL, button does not have a label. Since 2.4

setStockId
void setStockId(string stockId)

Warning gtk_tool_button_set_stock_id has been deprecated since version 3.10 and should not be used in newly-written code. Use gtk_tool_button_set_icon_name() instead. Sets the name of the stock item. See gtk_tool_button_new_from_stock(). The stock_id property only has an effect if not overridden by non-NULL "label" and "icon_widget" properties. Since 2.4

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
setUseUnderline
void setUseUnderline(int 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'. Labels shown on tool buttons never have mnemonics on them; this property only affects the menu item on the overflow menu. Since 2.4

Mixins

__anonymous
mixin ActionableT!(GtkToolButton)
Undocumented in source.

Static functions

callBackClicked
void callBackClicked(GtkToolButton* toolbuttonStruct, ToolButton _toolButton)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

connectedSignals
int[string] connectedSignals;
gtkToolButton
GtkToolButton* gtkToolButton;

the main Gtk struct

onClickedListeners
void delegate(ToolButton)[] onClickedListeners;
Undocumented in source.

Inherited Members

From ToolItem

gtkToolItem
GtkToolItem* gtkToolItem;

the main Gtk struct

getToolItemStruct
GtkToolItem* getToolItemStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
__anonymous
mixin ActivatableT!(GtkToolItem)
Undocumented in source.
connectedSignals
int[string] connectedSignals;
onCreateMenuProxyListeners
bool delegate(ToolItem)[] onCreateMenuProxyListeners;
Undocumented in source.
addOnCreateMenuProxy
void addOnCreateMenuProxy(bool delegate(ToolItem) dlg, ConnectFlags connectFlags)

This signal is emitted when the toolbar needs information from tool_item about whether the item should appear in the toolbar overflow menu. In response the tool item should either call gtk_tool_item_set_proxy_menu_item() with a NULL pointer and return TRUE to indicate that the item should not appear in the overflow menu call gtk_tool_item_set_proxy_menu_item() with a new menu item and return TRUE, or 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. The toolbar may cache the result of this signal. When the tool item changes how it will respond to this signal it must call gtk_tool_item_rebuild_menu() to invalidate the cache and ensure that the toolbar rebuilds its overflow menu. TRUE if the signal was handled, FALSE if not

callBackCreateMenuProxy
gboolean callBackCreateMenuProxy(GtkToolItem* toolItemStruct, ToolItem _toolItem)
Undocumented in source. Be warned that the author may not have intended to support it.
onToolbarReconfiguredListeners
void delegate(ToolItem)[] onToolbarReconfiguredListeners;
Undocumented in source.
addOnToolbarReconfigured
void addOnToolbarReconfigured(void delegate(ToolItem) dlg, ConnectFlags connectFlags)

This signal is emitted when some property of the toolbar that the item is a child of changes. For custom subclasses of GtkToolItem, the default handler of this signal use the functions gtk_tool_shell_get_orientation() gtk_tool_shell_get_style() gtk_tool_shell_get_icon_size() gtk_tool_shell_get_relief_style() to find out what the toolbar should look like and change themselves accordingly. See Also GtkToolbar The toolbar widget GtkToolButton A subclass of GtkToolItem that displays buttons on the toolbar GtkSeparatorToolItem A subclass of GtkToolItem that separates groups of items on a toolbar

callBackToolbarReconfigured
void callBackToolbarReconfigured(GtkToolItem* toolItemStruct, ToolItem _toolItem)
Undocumented in source. Be warned that the author may not have intended to support it.
setHomogeneous
void setHomogeneous(int 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. Since 2.4

getHomogeneous
int getHomogeneous()

Returns whether tool_item is the same size as other homogeneous items. See gtk_tool_item_set_homogeneous(). Since 2.4

setExpand
void setExpand(int 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. Since 2.4

getExpand
int getExpand()

Returns whether tool_item is allocated extra space. See gtk_tool_item_set_expand(). Since 2.4

setTooltipText
void setTooltipText(string text)

Sets the text to be displayed as tooltip on the item. See gtk_widget_set_tooltip_text(). Since 2.12

setTooltipMarkup
void setTooltipMarkup(string markup)

Sets the markup text to be displayed as tooltip on the item. See gtk_widget_set_tooltip_markup(). Since 2.12

setUseDragWindow
void setUseDragWindow(int useDragWindow)

Sets 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. Since 2.4

getUseDragWindow
int getUseDragWindow()

Returns whether tool_item has a drag window. See gtk_tool_item_set_use_drag_window(). Since 2.4

setVisibleHorizontal
void setVisibleHorizontal(int visibleHorizontal)

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

getVisibleHorizontal
int getVisibleHorizontal()

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

setVisibleVertical
void setVisibleVertical(int 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. Since 2.4

getVisibleVertical
int getVisibleVertical()

Returns whether tool_item is visible when the toolbar is docked vertically. See gtk_tool_item_set_visible_vertical(). Since 2.4

setIsImportant
void setIsImportant(int 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_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 2.4

getIsImportant
int getIsImportant()

Returns whether tool_item is considered important. See gtk_tool_item_set_is_important() Since 2.4

getEllipsizeMode
PangoEllipsizeMode 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. Since 2.20

getIconSize
GtkIconSize 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. Since 2.4

getOrientation
GtkOrientation 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. Since 2.4

getToolbarStyle
GtkToolbarStyle 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 Since 2.4

getReliefStyle
GtkReliefStyle getReliefStyle()

Returns the relief style of tool_item. See gtk_button_set_relief(). Custom subclasses of GtkToolItem should call this function in the handler of the "toolbar_reconfigured" signal to find out the relief style of buttons. Since 2.4

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. Since 2.20

getTextOrientation
GtkOrientation 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. Since 2.20

retrieveProxyMenuItem
Widget retrieveProxyMenuItem()

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. Since 2.4

getProxyMenuItem
Widget getProxyMenuItem(string menuItemId)

If menu_item_id matches the string passed to gtk_tool_item_set_proxy_menu_item() return the corresponding GtkMenuItem. Custom subclasses of GtkToolItem should use this function to update their menu item when the GtkToolItem changes. That the menu_item_ids must match ensures that a GtkToolItem will not inadvertently change a menu item that they did not create. Since 2.4

setProxyMenuItem
void setProxyMenuItem(string menuItemId, 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_get_proxy_menu_item(). Since 2.4

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. The function must be called when the tool item changes what it will do in response to the "create-menu-proxy" signal. Since 2.6

toolbarReconfigured
void toolbarReconfigured()

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

getTextSizeGroup
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. Since 2.20

From ActionableIF

getActionableTStruct
GtkActionable* getActionableTStruct()
Undocumented in source.
getStruct
void* getStruct()

the main Gtk struct as a void*

getActionName
string getActionName()

Gets the action name for actionable. See gtk_actionable_set_action_name() for more information.

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. Usually this function is used when the widget is located (or will be located) within the hierarchy of a GtkApplicationWindow. Names are of the form "win.save" or "app.quit" for actions on the containing GtkApplicationWindow or its associated GtkApplication, respectively. This is the same form used for actions in the GMenu associated with the window.

getActionTargetValue
Variant getActionTargetValue()

Gets the current target value of actionabe. See gtk_actionable_set_action_target_value() for more information.

setActionTargetValue
void setActionTargetValue(Variant targetValue)

Sets the target value of an actionable widget. If target_value is NULL then the target value is unset. The target value has two purposes. First, it is used as the parameter to activation of the action associated with the GtkActionable widget. Second, it is used to determine if the widget should be rendered as "active" - the widget is active if the state is equal to the given target. Consider the example of associating a set of buttons with a GAction with string state in a typical "radio button" situation. Each button will be associated with the same action, but with a different target value for that action. Clicking on a particular button will activate the action with the target of that button, which will typically cause the action's state to change to that value. Since the action's state is now equal to the target value of the button, the button will now be rendered as active (and the other buttons, with different targets, rendered inactive).

setDetailedActionName
void setDetailedActionName(string detailedActionName)

Sets the action-name and associated string target value of an actionable widget. This allows for the effect of both gtk_actionable_set_action_name() and gtk_actionable_set_action_target_value() in the common case that the target is string-valued. detailed_action_name is a string of the form "action::target" where action is the action name and target is the string to use as the target.

Meta