Gtk.Toolbar

Entities

Tagged Types

Access Types

Constants

Subprograms

Generic Instantiations

Description

A toolbar is created with a call to Gtk.Toolbar.Gtk_New.

A toolbar can contain instances of a subclass of Gtk.Tool_Item.Gtk_Tool_Item. To add a Gtk.Tool_Item.Gtk_Tool_Item to the a toolbar, use Gtk.Toolbar.Insert. To remove an item from the toolbar use Gtk.Container.Remove. To add a button to the toolbar, add an instance of Gtk.Tool_Button.Gtk_Tool_Button.

Toolbar items can be visually grouped by adding instances of Gtk.Separator_Tool_Item.Gtk_Separator_Tool_Item to the toolbar. If the GtkToolbar child property "expand" is TRUE and the property Gtk.Separator_Tool_Item.Gtk_Separator_Tool_Item:draw is set to FALSE, the effect is to force all following items to the end of the toolbar.

By default, a toolbar can be shrunk, upon which it will add an arrow button to show an overflow menu offering access to any Gtk.Tool_Item.Gtk_Tool_Item child that has a proxy menu item. To disable this and request enough size for all children, call Gtk.Toolbar.Set_Show_Arrow to set Gtk.Toolbar.Gtk_Toolbar:show-arrow to False.

Creating a context menu for the toolbar can be done by connecting to the Gtk.Toolbar.Gtk_Toolbar::popup-context-menu signal.

# CSS nodes

GtkToolbar has a single CSS node with name toolbar.

"+"

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

"+"

function "+"
  (Widget : access Gtk_Toolbar_Record'Class)
return Gtk.Orientable.Gtk_Orientable
Parameters
Widget
Return Value

"+"

function "+"
  (Widget : access Gtk_Toolbar_Record'Class)
return Gtk.Tool_Shell.Gtk_Tool_Shell
Parameters
Widget
Return Value

"-"

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

"-"

function "-"
  (Interf : Gtk.Orientable.Gtk_Orientable)
return Gtk_Toolbar
Parameters
Interf
Return Value

"-"

function "-"
  (Interf : Gtk.Tool_Shell.Gtk_Tool_Shell)
return Gtk_Toolbar
Parameters
Interf
Return Value

Cb_GObject_Boolean_Boolean

type Cb_GObject_Boolean_Boolean is not null access function
  (Self       : access Glib.Object.GObject_Record'Class;
   Focus_Home : Boolean) return Boolean;
Parameters
Self
Focus_Home
Return Value

Cb_GObject_Gint_Gint_Gint_Boolean

type Cb_GObject_Gint_Gint_Gint_Boolean is not null access function
  (Self   : access Glib.Object.GObject_Record'Class;
   X      : Glib.Gint;
   Y      : Glib.Gint;
   Button : Glib.Gint) return Boolean;
Parameters
Self
X
Y
Button
Return Value

Cb_GObject_Gtk_Orientation_Void

type Cb_GObject_Gtk_Orientation_Void is not null access procedure
  (Self        : access Glib.Object.GObject_Record'Class;
   Orientation : Gtk.Enums.Gtk_Orientation);
Parameters
Self
Orientation

Cb_GObject_Gtk_Toolbar_Style_Void

type Cb_GObject_Gtk_Toolbar_Style_Void is not null access procedure
  (Self  : access Glib.Object.GObject_Record'Class;
   Style : Gtk.Enums.Gtk_Toolbar_Style);
Parameters
Self
Style

Cb_Gtk_Toolbar_Boolean_Boolean

type Cb_Gtk_Toolbar_Boolean_Boolean is not null access function
  (Self       : access Gtk_Toolbar_Record'Class;
   Focus_Home : Boolean) return Boolean;
Parameters
Self
Focus_Home
Return Value

Cb_Gtk_Toolbar_Gint_Gint_Gint_Boolean

type Cb_Gtk_Toolbar_Gint_Gint_Gint_Boolean is not null access function
  (Self   : access Gtk_Toolbar_Record'Class;
   X      : Glib.Gint;
   Y      : Glib.Gint;
   Button : Glib.Gint) return Boolean;
Parameters
Self
X
Y
Button
Return Value

Cb_Gtk_Toolbar_Gtk_Orientation_Void

type Cb_Gtk_Toolbar_Gtk_Orientation_Void is not null access procedure
  (Self        : access Gtk_Toolbar_Record'Class;
   Orientation : Gtk.Enums.Gtk_Orientation);
Parameters
Self
Orientation

Cb_Gtk_Toolbar_Gtk_Toolbar_Style_Void

type Cb_Gtk_Toolbar_Gtk_Toolbar_Style_Void is not null access procedure
  (Self  : access Gtk_Toolbar_Record'Class;
   Style : Gtk.Enums.Gtk_Toolbar_Style);
Parameters
Self
Style

Get_Drop_Index

function Get_Drop_Index
   (Toolbar : not null access Gtk_Toolbar_Record;
    X       : Glib.Gint;
    Y       : Glib.Gint) return Glib.Gint

Returns the position corresponding to the indicated point on Toolbar. This is useful when dragging items to the toolbar: this function returns the position a new item should be inserted. X and Y are in Toolbar coordinates. Since: gtk+ 2.4

Parameters
Toolbar
X

x coordinate of a point on the toolbar

Y

y coordinate of a point on the toolbar

Return Value

The position corresponding to the point (X, Y) on the toolbar.

Get_Ellipsize_Mode

function Get_Ellipsize_Mode
   (Self : not null access Gtk_Toolbar_Record)
    return Pango.Layout.Pango_Ellipsize_Mode
Parameters
Self
Return Value

Get_Icon_Size

function Get_Icon_Size
   (Toolbar : not null access Gtk_Toolbar_Record)
    return Gtk.Enums.Gtk_Icon_Size

Retrieves the icon size for the toolbar. See Gtk.Toolbar.Set_Icon_Size.

Parameters
Toolbar
Return Value

the current icon size for the icons on the toolbar.

Get_Item_Index

function Get_Item_Index
   (Toolbar : not null access Gtk_Toolbar_Record;
    Item    : not null access Gtk.Tool_Item.Gtk_Tool_Item_Record'Class)
    return Glib.Gint

Returns the position of Item on the toolbar, starting from 0. It is an error if Item is not a child of the toolbar. Since: gtk+ 2.4

Parameters
Toolbar
Item

a Gtk.Tool_Item.Gtk_Tool_Item that is a child of Toolbar

Return Value

the position of item on the toolbar.

Get_N_Items

function Get_N_Items
   (Toolbar : not null access Gtk_Toolbar_Record) return Glib.Gint

Returns the number of items on the toolbar. Since: gtk+ 2.4

Parameters
Toolbar
Return Value

the number of items on the toolbar

Get_Nth_Item

function Get_Nth_Item
   (Toolbar : not null access Gtk_Toolbar_Record;
    N       : Glib.Gint) return Gtk.Tool_Item.Gtk_Tool_Item

Returns the N'th item on Toolbar, or null if the toolbar does not contain an N'th item. Since: gtk+ 2.4

Parameters
Toolbar
N

A position on the toolbar

Return Value

The N'th Gtk.Tool_Item.Gtk_Tool_Item on Toolbar, or null if there isn't an N'th item.

Get_Orientation

function Get_Orientation
   (Self : not null access Gtk_Toolbar_Record)
    return Gtk.Enums.Gtk_Orientation
Parameters
Self
Return Value

Get_Relief_Style

function Get_Relief_Style
   (Toolbar : not null access Gtk_Toolbar_Record)
    return Gtk.Enums.Gtk_Relief_Style

Returns the relief style of buttons on Toolbar. See Gtk.Button.Set_Relief. Since: gtk+ 2.4

Parameters
Toolbar
Return Value

The relief style of buttons on Toolbar.

Get_Show_Arrow

function Get_Show_Arrow
   (Toolbar : not null access Gtk_Toolbar_Record) return Boolean

Returns whether the toolbar has an overflow menu. See Gtk.Toolbar.Set_Show_Arrow. Since: gtk+ 2.4

Parameters
Toolbar
Return Value

True if the toolbar has an overflow menu.

Get_Style

function Get_Style
   (Toolbar : not null access Gtk_Toolbar_Record)
    return Gtk.Enums.Gtk_Toolbar_Style

Retrieves whether the toolbar has text, icons, or both . See Gtk.Toolbar.Set_Style.

Parameters
Toolbar
Return Value

the current style of Toolbar

Get_Text_Alignment

function Get_Text_Alignment
   (Self : not null access Gtk_Toolbar_Record) return Gfloat
Parameters
Self
Return Value

Get_Text_Orientation

function Get_Text_Orientation
   (Self : not null access Gtk_Toolbar_Record)
    return Gtk.Enums.Gtk_Orientation
Parameters
Self
Return Value

Get_Text_Size_Group

function Get_Text_Size_Group
   (Self : not null access Gtk_Toolbar_Record)
    return Gtk.Size_Group.Gtk_Size_Group
Parameters
Self
Return Value

Get_Type

function Get_Type return Glib.GType
Return Value

Gtk_New

procedure Gtk_New (Toolbar : out Gtk_Toolbar)

Creates a new toolbar. Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Toolbar

Gtk_Toolbar

type Gtk_Toolbar is access all Gtk_Toolbar_Record'Class;

Gtk_Toolbar_New

function Gtk_Toolbar_New return Gtk_Toolbar

Creates a new toolbar.

Return Value

Gtk_Toolbar_Record

type Gtk_Toolbar_Record is new Gtk_Container_Record with null record;

Icon_Size_Property

Icon_Size_Property : constant Gtk.Enums.Property_Gtk_Icon_Size;

The size of the icons in a toolbar is normally determined by the toolbar-icon-size setting. When this property is set, it overrides the setting.

This should only be used for special-purpose toolbars, normal application toolbars should respect the user preferences for the size of icons.

Icon_Size_Set_Property

Icon_Size_Set_Property : constant Glib.Properties.Property_Boolean;

Is True if the icon-size property has been set.

Implements_Gtk_Buildable

package Implements_Gtk_Buildable is new Glib.Types.Implements
  (Gtk.Buildable.Gtk_Buildable, Gtk_Toolbar_Record, Gtk_Toolbar);

Implements_Gtk_Orientable

package Implements_Gtk_Orientable is new Glib.Types.Implements
  (Gtk.Orientable.Gtk_Orientable, Gtk_Toolbar_Record, Gtk_Toolbar);

Implements_Gtk_Tool_Shell

package Implements_Gtk_Tool_Shell is new Glib.Types.Implements
  (Gtk.Tool_Shell.Gtk_Tool_Shell, Gtk_Toolbar_Record, Gtk_Toolbar);

Initialize

procedure Initialize (Toolbar : not null access Gtk_Toolbar_Record'Class)

Creates a new toolbar. Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Toolbar

Insert

procedure Insert
   (Toolbar : not null access Gtk_Toolbar_Record;
    Item    : not null access Gtk.Tool_Item.Gtk_Tool_Item_Record'Class;
    Pos     : Glib.Gint := -1)

Insert a Gtk.Tool_Item.Gtk_Tool_Item into the toolbar at position Pos. If Pos is 0 the item is prepended to the start of the toolbar. If Pos is negative, the item is appended to the end of the toolbar. Since: gtk+ 2.4

Parameters
Toolbar
Item

a Gtk.Tool_Item.Gtk_Tool_Item

Pos

the position of the new item

On_Focus_Home_Or_End

procedure On_Focus_Home_Or_End
   (Self  : not null access Gtk_Toolbar_Record;
    Call  : Cb_GObject_Boolean_Boolean;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

A keybinding signal used internally by GTK+. This signal can't be used in application code

Callback parameters: -- @param Focus_Home True if the first item should be focused

Parameters
Self
Call
Slot
After

On_Focus_Home_Or_End

procedure On_Focus_Home_Or_End
   (Self  : not null access Gtk_Toolbar_Record;
    Call  : Cb_Gtk_Toolbar_Boolean_Boolean;
    After : Boolean := False)

A keybinding signal used internally by GTK+. This signal can't be used in application code

Callback parameters: -- @param Focus_Home True if the first item should be focused

Parameters
Self
Call
After

On_Orientation_Changed

procedure On_Orientation_Changed
   (Self  : not null access Gtk_Toolbar_Record;
    Call  : Cb_GObject_Gtk_Orientation_Void;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

Emitted when the orientation of the toolbar changes.

Parameters
Self
Call
Slot
After

On_Orientation_Changed

procedure On_Orientation_Changed
   (Self  : not null access Gtk_Toolbar_Record;
    Call  : Cb_Gtk_Toolbar_Gtk_Orientation_Void;
    After : Boolean := False)

Emitted when the orientation of the toolbar changes.

Parameters
Self
Call
After

On_Popup_Context_Menu

procedure On_Popup_Context_Menu
   (Self  : not null access Gtk_Toolbar_Record;
    Call  : Cb_GObject_Gint_Gint_Gint_Boolean;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

Emitted when the user right-clicks the toolbar or uses the keybinding to display a popup menu.

Application developers should handle this signal if they want to display a context menu on the toolbar. The context-menu should appear at the coordinates given by X and Y. The mouse button number is given by the Button parameter. If the menu was popped up using the keybaord, Button is -1.

Callback parameters: -- @param X the x coordinate of the point where the menu should appear -- @param Y the y coordinate of the point where the menu should appear -- @param Button the mouse button the user pressed, or -1

Parameters
Self
Call
Slot
After

On_Popup_Context_Menu

procedure On_Popup_Context_Menu
   (Self  : not null access Gtk_Toolbar_Record;
    Call  : Cb_Gtk_Toolbar_Gint_Gint_Gint_Boolean;
    After : Boolean := False)

Emitted when the user right-clicks the toolbar or uses the keybinding to display a popup menu.

Application developers should handle this signal if they want to display a context menu on the toolbar. The context-menu should appear at the coordinates given by X and Y. The mouse button number is given by the Button parameter. If the menu was popped up using the keybaord, Button is -1.

Callback parameters: -- @param X the x coordinate of the point where the menu should appear -- @param Y the y coordinate of the point where the menu should appear -- @param Button the mouse button the user pressed, or -1

Parameters
Self
Call
After

On_Style_Changed

procedure On_Style_Changed
   (Self  : not null access Gtk_Toolbar_Record;
    Call  : Cb_GObject_Gtk_Toolbar_Style_Void;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

Emitted when the style of the toolbar changes.

Parameters
Self
Call
Slot
After

On_Style_Changed

procedure On_Style_Changed
   (Self  : not null access Gtk_Toolbar_Record;
    Call  : Cb_Gtk_Toolbar_Gtk_Toolbar_Style_Void;
    After : Boolean := False)

Emitted when the style of the toolbar changes.

Parameters
Self
Call
After

Rebuild_Menu

procedure Rebuild_Menu (Self : not null access Gtk_Toolbar_Record)
Parameters
Self

Set_Drop_Highlight_Item

procedure Set_Drop_Highlight_Item
   (Toolbar   : not null access Gtk_Toolbar_Record;
    Tool_Item : access Gtk.Tool_Item.Gtk_Tool_Item_Record'Class;
    Index     : Glib.Gint)

Highlights Toolbar to give an idea of what it would look like if Item was added to Toolbar at the position indicated by Index_. If Item is null, highlighting is turned off. In that case Index_ is ignored. The Tool_Item passed to this function must not be part of any widget hierarchy. When an item is set as drop highlight item it can not added to any widget hierarchy or used as highlight item for another toolbar. Since: gtk+ 2.4

Parameters
Toolbar
Tool_Item

a Gtk.Tool_Item.Gtk_Tool_Item, or null to turn of highlighting

Index

a position on Toolbar

Set_Icon_Size

procedure Set_Icon_Size
   (Toolbar   : not null access Gtk_Toolbar_Record;
    Icon_Size : Gtk.Enums.Gtk_Icon_Size)

This function sets the size of stock icons in the toolbar. You can call it both before you add the icons and after they've been added. The size you set will override user preferences for the default icon size. This should only be used for special-purpose toolbars, normal application toolbars should respect the user preferences for the size of icons.

Parameters
Toolbar
Icon_Size

The Gtk.Enums.Gtk_Icon_Size that stock icons in the toolbar shall have.

Set_Orientation

procedure Set_Orientation
   (Self        : not null access Gtk_Toolbar_Record;
    Orientation : Gtk.Enums.Gtk_Orientation)
Parameters
Self
Orientation

Set_Show_Arrow

procedure Set_Show_Arrow
   (Toolbar    : not null access Gtk_Toolbar_Record;
    Show_Arrow : Boolean := True)

Sets whether to show an overflow menu when Toolbar isn't allocated enough size to show all of its items. If True, items which can't fit in Toolbar, and which have a proxy menu item set by Gtk.Tool_Item.Set_Proxy_Menu_Item or Gtk.Tool_Item.Gtk_Tool_Item::create-menu-proxy, will be available in an overflow menu, which can be opened by an added arrow button. If False, Toolbar will request enough size to fit all of its child items without any overflow. Since: gtk+ 2.4

Parameters
Toolbar
Show_Arrow

Whether to show an overflow menu

Set_Style

procedure Set_Style
   (Toolbar : not null access Gtk_Toolbar_Record;
    Style   : Gtk.Enums.Gtk_Toolbar_Style)

Alters the view of Toolbar to display either icons only, text only, or both.

Parameters
Toolbar
Style

the new style for Toolbar.

Show_Arrow_Property

Show_Arrow_Property : constant Glib.Properties.Property_Boolean;

Signal_Focus_Home_Or_End

Signal_Focus_Home_Or_End : constant Glib.Signal_Name := "focus-home-or-end";

A keybinding signal used internally by GTK+. This signal can't be used in application code

Callback parameters: -- @param Focus_Home True if the first item should be focused

Signal_Orientation_Changed

Signal_Orientation_Changed : constant Glib.Signal_Name := "orientation-changed";

Emitted when the orientation of the toolbar changes.

Signal_Popup_Context_Menu

Signal_Popup_Context_Menu : constant Glib.Signal_Name := "popup-context-menu";

Emitted when the user right-clicks the toolbar or uses the keybinding to display a popup menu.

Application developers should handle this signal if they want to display a context menu on the toolbar. The context-menu should appear at the coordinates given by X and Y. The mouse button number is given by the Button parameter. If the menu was popped up using the keybaord, Button is -1.

Callback parameters: -- @param X the x coordinate of the point where the menu should appear -- @param Y the y coordinate of the point where the menu should appear -- @param Button the mouse button the user pressed, or -1

Signal_Style_Changed

Signal_Style_Changed : constant Glib.Signal_Name := "style-changed";

Emitted when the style of the toolbar changes.

Toolbar_Style_Property

Toolbar_Style_Property : constant Gtk.Enums.Property_Gtk_Toolbar_Style;

Unset_Icon_Size

procedure Unset_Icon_Size (Toolbar : not null access Gtk_Toolbar_Record)

Unsets toolbar icon size set with Gtk.Toolbar.Set_Icon_Size, so that user preferences will be used to determine the icon size.

Parameters
Toolbar

Unset_Style

procedure Unset_Style (Toolbar : not null access Gtk_Toolbar_Record)

Unsets a toolbar style set with Gtk.Toolbar.Set_Style, so that user preferences will be used to determine the toolbar style.

Parameters
Toolbar