Gtk.Tool_Button

Entities

Tagged Types

Access Types

Constants

Subprograms

Generic Instantiations

Description

Gtk_Tool_Buttons are Gtk_Tool_Items containing buttons.

Use Gtk.Tool_Button.Gtk_New to create a new Gtk.Tool_Button.Gtk_Tool_Button.

The label of a Gtk.Tool_Button.Gtk_Tool_Button is determined by the properties Gtk.Tool_Button.Gtk_Tool_Button:label-widget, Gtk.Tool_Button.Gtk_Tool_Button:label, and Gtk.Tool_Button.Gtk_Tool_Button:stock-id. If Gtk.Tool_Button.Gtk_Tool_Button:label-widget is non-null, then that widget is used as the label. Otherwise, if Gtk.Tool_Button.Gtk_Tool_Button:label is non-null, that string is used as the label. Otherwise, if Gtk.Tool_Button.Gtk_Tool_Button: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 Gtk.Tool_Button.Gtk_Tool_Button is determined by the properties Gtk.Tool_Button.Gtk_Tool_Button:icon-widget and Gtk.Tool_Button.Gtk_Tool_Button:stock-id. If Gtk.Tool_Button.Gtk_Tool_Button:icon-widget is non-null, then that widget is used as the icon. Otherwise, if Gtk.Tool_Button.Gtk_Tool_Button: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.

"+"

function "+"
  (Widget : access Gtk_Tool_Button_Record'Class)
return Gtk.Actionable.Gtk_Actionable
Parameters
Widget
Return Value

"+"

function "+"
  (Widget : access Gtk_Tool_Button_Record'Class)
return Gtk.Activatable.Gtk_Activatable
Parameters
Widget
Return Value

"+"

function "+"
  (Widget : access Gtk_Tool_Button_Record'Class)
return Gtk.Buildable.Gtk_Buildable
Parameters
Widget
Return Value

"-"

function "-"
  (Interf : Gtk.Actionable.Gtk_Actionable)
return Gtk_Tool_Button
Parameters
Interf
Return Value

"-"

function "-"
  (Interf : Gtk.Activatable.Gtk_Activatable)
return Gtk_Tool_Button
Parameters
Interf
Return Value

"-"

function "-"
  (Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Tool_Button
Parameters
Interf
Return Value

Cb_GObject_Void

type Cb_GObject_Void is not null access procedure
  (Self : access Glib.Object.GObject_Record'Class);
Parameters
Self

Cb_Gtk_Tool_Button_Void

type Cb_Gtk_Tool_Button_Void is not null access procedure
  (Self : access Gtk_Tool_Button_Record'Class);
Parameters
Self

Do_Set_Related_Action

procedure Do_Set_Related_Action
   (Self   : not null access Gtk_Tool_Button_Record;
    Action : not null access Gtk.Action.Gtk_Action_Record'Class)
Parameters
Self
Action

Get_Action_Name

function Get_Action_Name
   (Self : not null access Gtk_Tool_Button_Record) return UTF8_String
Parameters
Self
Return Value

Get_Action_Target_Value

function Get_Action_Target_Value
   (Self : not null access Gtk_Tool_Button_Record)
    return Glib.Variant.Gvariant
Parameters
Self
Return Value

Get_Icon_Name

function Get_Icon_Name
   (Button : not null access Gtk_Tool_Button_Record) return UTF8_String

Returns the name of the themed icon for the tool button, see Gtk.Tool_Button.Set_Icon_Name. Since: gtk+ 2.8

Parameters
Button
Return Value

the icon name or null if the tool button has no themed icon

Get_Icon_Widget

function Get_Icon_Widget
   (Button : not null access Gtk_Tool_Button_Record)
    return Gtk.Widget.Gtk_Widget

Return the widget used as icon widget on Button. See Gtk.Tool_Button.Set_Icon_Widget. Since: gtk+ 2.4

Parameters
Button
Return Value

The widget used as icon on Button, or null.

Get_Label

function Get_Label
   (Button : not null access Gtk_Tool_Button_Record) return UTF8_String

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: gtk+ 2.4

Parameters
Button
Return Value

The label, or null

Get_Label_Widget

function Get_Label_Widget
   (Button : not null access Gtk_Tool_Button_Record)
    return Gtk.Widget.Gtk_Widget

Returns the widget used as label on Button. See Gtk.Tool_Button.Set_Label_Widget. Since: gtk+ 2.4

Parameters
Button
Return Value

The widget used as label on Button, or null.

Get_Related_Action

function Get_Related_Action
   (Self : not null access Gtk_Tool_Button_Record)
    return Gtk.Action.Gtk_Action
Parameters
Self
Return Value

Get_Stock_Id

function Get_Stock_Id
   (Button : not null access Gtk_Tool_Button_Record) return UTF8_String

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: gtk+ 2.4 Deprecated since 3.10, 1

Parameters
Button
Return Value

the name of the stock item for Button.

Get_Type

function Get_Type return Glib.GType
Return Value

Get_Use_Action_Appearance

function Get_Use_Action_Appearance
   (Self : not null access Gtk_Tool_Button_Record) return Boolean
Parameters
Self
Return Value

Get_Use_Underline

function Get_Use_Underline
   (Button : not null access Gtk_Tool_Button_Record) return Boolean

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: gtk+ 2.4

Parameters
Button
Return Value

True if underscores in the label property are used as mnemonics on menu items on the overflow menu.

Gtk_New

procedure Gtk_New
   (Button      : out Gtk_Tool_Button;
    Icon_Widget : Gtk.Widget.Gtk_Widget := null;
    Label       : UTF8_String := "")

Creates a new Gtk.Tool_Button.Gtk_Tool_Button using Icon_Widget as contents and Label as label. Since: gtk+ 2.4 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Button
Icon_Widget

a widget that will be used as the button contents, or null

Label

a string that will be used as label, or null

Gtk_New_From_Stock

procedure Gtk_New_From_Stock
   (Button   : out Gtk_Tool_Button;
    Stock_Id : UTF8_String)

Creates a new Gtk.Tool_Button.Gtk_Tool_Button 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: gtk+ 2.4 Initialize_From_Stock does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Button
Stock_Id

the name of the stock item

Gtk_Tool_Button

type Gtk_Tool_Button is access all Gtk_Tool_Button_Record'Class;

Gtk_Tool_Button_New

function Gtk_Tool_Button_New
   (Icon_Widget : Gtk.Widget.Gtk_Widget := null;
    Label       : UTF8_String := "") return Gtk_Tool_Button

Creates a new Gtk.Tool_Button.Gtk_Tool_Button using Icon_Widget as contents and Label as label. Since: gtk+ 2.4

Parameters
Icon_Widget

a widget that will be used as the button contents, or null

Label

a string that will be used as label, or null

Return Value

Gtk_Tool_Button_New_From_Stock

function Gtk_Tool_Button_New_From_Stock
   (Stock_Id : UTF8_String) return Gtk_Tool_Button

Creates a new Gtk.Tool_Button.Gtk_Tool_Button 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: gtk+ 2.4

Parameters
Stock_Id

the name of the stock item

Return Value

Gtk_Tool_Button_Record

type Gtk_Tool_Button_Record is new Gtk_Tool_Item_Record with null record;

Icon_Name_Property

Icon_Name_Property : constant Glib.Properties.Property_String;

The name of the themed icon displayed on the item. This property only has an effect if not overridden by Gtk.Tool_Button.Gtk_Tool_Button:label-widget, Gtk.Tool_Button.Gtk_Tool_Button:icon-widget or Gtk.Tool_Button.Gtk_Tool_Button:stock-id properties.

Icon_Widget_Property

Icon_Widget_Property : constant Glib.Properties.Property_Object;

Type: Gtk.Widget.Gtk_Widget

Implements_Gtk_Actionable

package Implements_Gtk_Actionable is new Glib.Types.Implements
  (Gtk.Actionable.Gtk_Actionable, Gtk_Tool_Button_Record, Gtk_Tool_Button);

Implements_Gtk_Activatable

package Implements_Gtk_Activatable is new Glib.Types.Implements
  (Gtk.Activatable.Gtk_Activatable, Gtk_Tool_Button_Record, Gtk_Tool_Button);

Implements_Gtk_Buildable

package Implements_Gtk_Buildable is new Glib.Types.Implements
  (Gtk.Buildable.Gtk_Buildable, Gtk_Tool_Button_Record, Gtk_Tool_Button);

Initialize

procedure Initialize
   (Button      : not null access Gtk_Tool_Button_Record'Class;
    Icon_Widget : Gtk.Widget.Gtk_Widget := null;
    Label       : UTF8_String := "")

Creates a new Gtk.Tool_Button.Gtk_Tool_Button using Icon_Widget as contents and Label as label. Since: gtk+ 2.4 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Button
Icon_Widget

a widget that will be used as the button contents, or null

Label

a string that will be used as label, or null

Initialize_From_Stock

procedure Initialize_From_Stock
   (Button   : not null access Gtk_Tool_Button_Record'Class;
    Stock_Id : UTF8_String)

Creates a new Gtk.Tool_Button.Gtk_Tool_Button 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: gtk+ 2.4 Initialize_From_Stock does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Button
Stock_Id

the name of the stock item

Label_Property

Label_Property : constant Glib.Properties.Property_String;

Label_Widget_Property

Label_Widget_Property : constant Glib.Properties.Property_Object;

Type: Gtk.Widget.Gtk_Widget

On_Clicked

procedure On_Clicked
   (Self  : not null access Gtk_Tool_Button_Record;
    Call  : Cb_GObject_Void;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

This signal is emitted when the tool button is clicked with the mouse or activated with the keyboard.

Parameters
Self
Call
Slot
After

On_Clicked

procedure On_Clicked
   (Self  : not null access Gtk_Tool_Button_Record;
    Call  : Cb_Gtk_Tool_Button_Void;
    After : Boolean := False)

This signal is emitted when the tool button is clicked with the mouse or activated with the keyboard.

Parameters
Self
Call
After

Set_Action_Name

procedure Set_Action_Name
   (Self        : not null access Gtk_Tool_Button_Record;
    Action_Name : UTF8_String := "")
Parameters
Self
Action_Name

Set_Action_Target_Value

procedure Set_Action_Target_Value
   (Self         : not null access Gtk_Tool_Button_Record;
    Target_Value : Glib.Variant.Gvariant)
Parameters
Self
Target_Value

Set_Detailed_Action_Name

procedure Set_Detailed_Action_Name
   (Self                 : not null access Gtk_Tool_Button_Record;
    Detailed_Action_Name : UTF8_String)
Parameters
Self
Detailed_Action_Name

Set_Icon_Name

procedure Set_Icon_Name
   (Button    : not null access Gtk_Tool_Button_Record;
    Icon_Name : UTF8_String := "")

Sets the icon for the tool button from a named themed icon. See the docs for Gtk.Icon_Theme.Gtk_Icon_Theme for more details. The Gtk.Tool_Button.Gtk_Tool_Button:icon-name property only has an effect if not overridden by non-null Gtk.Tool_Button.Gtk_Tool_Button:label-widget, Gtk.Tool_Button.Gtk_Tool_Button:icon-widget and Gtk.Tool_Button.Gtk_Tool_Button:stock-id properties. Since: gtk+ 2.8

Parameters
Button
Icon_Name

the name of the themed icon

Set_Icon_Widget

procedure Set_Icon_Widget
   (Button      : not null access Gtk_Tool_Button_Record;
    Icon_Widget : access Gtk.Widget.Gtk_Widget_Record'Class)

Sets Icon as the widget used as icon on Button. If Icon_Widget is null the icon is determined by the Gtk.Tool_Button.Gtk_Tool_Button:stock-id property. If the Gtk.Tool_Button.Gtk_Tool_Button:stock-id property is also null, Button will not have an icon. Since: gtk+ 2.4

Parameters
Button
Icon_Widget

the widget used as icon, or null

Set_Label

procedure Set_Label
   (Button : not null access Gtk_Tool_Button_Record;
    Label  : UTF8_String := "")

Sets Label as the label used for the tool button. The Gtk.Tool_Button.Gtk_Tool_Button:label property only has an effect if not overridden by a non-null Gtk.Tool_Button.Gtk_Tool_Button:label-widget property. If both the Gtk.Tool_Button.Gtk_Tool_Button:label-widget and Gtk.Tool_Button.Gtk_Tool_Button:label properties are null, the label is determined by the Gtk.Tool_Button.Gtk_Tool_Button:stock-id property. If the Gtk.Tool_Button.Gtk_Tool_Button:stock-id property is also null, Button will not have a label. Since: gtk+ 2.4

Parameters
Button
Label

a string that will be used as label, or null.

Set_Label_Widget

procedure Set_Label_Widget
   (Button       : not null access Gtk_Tool_Button_Record;
    Label_Widget : access Gtk.Widget.Gtk_Widget_Record'Class)

Sets Label_Widget as the widget that will be used as the label for Button. If Label_Widget is null the Gtk.Tool_Button.Gtk_Tool_Button:label property is used as label. If Gtk.Tool_Button.Gtk_Tool_Button:label is also null, the label in the stock item determined by the Gtk.Tool_Button.Gtk_Tool_Button:stock-id property is used as label. If Gtk.Tool_Button.Gtk_Tool_Button:stock-id is also null, Button does not have a label. Since: gtk+ 2.4

Parameters
Button
Label_Widget

the widget used as label, or null

Set_Related_Action

procedure Set_Related_Action
   (Self   : not null access Gtk_Tool_Button_Record;
    Action : not null access Gtk.Action.Gtk_Action_Record'Class)
Parameters
Self
Action

Set_Stock_Id

procedure Set_Stock_Id
   (Button   : not null access Gtk_Tool_Button_Record;
    Stock_Id : UTF8_String := "")

Sets the name of the stock item. See Gtk.Tool_Button.Gtk_New_From_Stock. The stock_id property only has an effect if not overridden by non-null Gtk.Tool_Button.Gtk_Tool_Button:label-widget and Gtk.Tool_Button.Gtk_Tool_Button:icon-widget properties. Since: gtk+ 2.4 Deprecated since 3.10, 1

Parameters
Button
Stock_Id

a name of a stock item, or null

Set_Use_Action_Appearance

procedure Set_Use_Action_Appearance
   (Self           : not null access Gtk_Tool_Button_Record;
    Use_Appearance : Boolean)
Parameters
Self
Use_Appearance

Set_Use_Underline

procedure Set_Use_Underline
   (Button        : not null access Gtk_Tool_Button_Record;
    Use_Underline : Boolean)

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: gtk+ 2.4

Parameters
Button
Use_Underline

whether the button label has the form "_Open"

Signal_Clicked

Signal_Clicked : constant Glib.Signal_Name := "clicked";

This signal is emitted when the tool button is clicked with the mouse or activated with the keyboard.

Stock_Id_Property

Stock_Id_Property : constant Glib.Properties.Property_String;

Sync_Action_Properties

procedure Sync_Action_Properties
   (Self   : not null access Gtk_Tool_Button_Record;
    Action : access Gtk.Action.Gtk_Action_Record'Class)
Parameters
Self
Action

Use_Underline_Property

Use_Underline_Property : constant Glib.Properties.Property_Boolean;