ToolButtons are ToolItems containing buttons.
Use ToolButton to create a new ToolButton
.
The label of a ToolButton 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 ToolButton 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.
CSS nodes
GtkToolButton has a single CSS node with name toolbutton.
- public unowned string? get_icon_name ()
Returns the name of the themed icon for the tool button, see
set_icon_name.
- public unowned Widget? get_icon_widget ()
Return the widget used as icon widget on
this.
- public unowned string? get_label ()
Returns the label used by the tool button, or
null if the tool button doesn’t have a label.
- public unowned Widget? get_label_widget ()
Returns the widget used as label on this
.
- public unowned string get_stock_id ()
Returns the name of the stock item.
- public bool get_use_underline ()
Returns whether underscores in the label property are used as
mnemonics on menu items on the overflow menu.
- public void set_icon_name (string? icon_name)
Sets the icon for the tool button from a named themed icon.
- public void set_icon_widget (Widget? icon_widget)
Sets icon
as the widget used as icon on
this.
- public void set_label (string? label)
Sets label
as the label used for the tool button.
- public void set_label_widget (Widget? label_widget)
Sets label_widget
as the widget that will be used as the
label for this.
- public void set_stock_id (string? stock_id)
Sets the name of the stock item.
- public void set_use_underline (bool use_underline)
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.