Index

Package: Toolbar

Description

package Gtk.Toolbar is

A toolbar groups a number of items (buttons, combo boxes,...), generally at the top of the application window, just below the menu bar. It provides quick access to the most commonly used features of your application.

It is common for an application to have multiple toolbars.

Binding from C File version 2.8.17

<testgtk>create_toolbar.adb</testgtk>

Screenshot

gtk-toolbar.png

Classes

Gtk_Toolbar_Record

type Gtk_Toolbar_Record is new
     Gtk.Container.Gtk_Container_Record with private;

Ancestors:

Immediate Children:

Primitive operations:

Append_Element
Append_Space
Append_Widget
Get_Drop_Index
Get_Icon_Size
Get_Item_Index
Get_Nth_Item
Get_Orientation
Get_Relief_Style
Get_Show_Arrow
Get_Tooltips
Glib.Object.Deallocate (Inherited)
Glib.Object.Get_Type (Inherited)
Glib.Object.Notify (Inherited)
Glib.Object.Ref (Inherited)
Glib.Object.Ref_Sink (Inherited)
Glib.Object.Unref (Inherited)
Gtk.Container.Add (Inherited)
Gtk.Container.Check_Resize (Inherited)
Gtk.Container.Child_Get_Property (Inherited)
Gtk.Container.Child_Set_Property (Inherited)
Gtk.Container.Child_Type (Inherited)
Gtk.Container.Forall (Inherited)
Gtk.Container.Foreach (Inherited)
Gtk.Container.Get_Border_Width (Inherited)
Gtk.Container.Get_Children (Inherited)
Gtk.Container.Get_Focus_Chain (Inherited)
Gtk.Container.Get_Focus_Child (Inherited)
Gtk.Container.Get_Focus_Hadjustment (Inherited)
Gtk.Container.Get_Focus_Vadjustment (Inherited)
Gtk.Container.Get_Resize_Mode (Inherited)
Gtk.Container.Propagate_Expose (Inherited)
Gtk.Container.Remove (Inherited)
Gtk.Container.Resize_Children (Inherited)
Gtk.Container.Set_Border_Width (Inherited)
Gtk.Container.Set_Focus_Chain (Inherited)
Gtk.Container.Set_Focus_Child (Inherited)
Gtk.Container.Set_Focus_Hadjustment (Inherited)
Gtk.Container.Set_Focus_Vadjustment (Inherited)
Gtk.Container.Set_Reallocate_Redraws (Inherited)
Gtk.Container.Set_Resize_Mode (Inherited)
Gtk.Container.Unset_Focus_Chain (Inherited)
Gtk.Widget.Activate (Inherited)
Gtk.Widget.Add_Accelerator (Inherited)
Gtk.Widget.Add_Events (Inherited)
Gtk.Widget.Add_Mnemonic_Label (Inherited)
Gtk.Widget.Can_Activate_Accel (Inherited)
Gtk.Widget.Child_Notify (Inherited)
Gtk.Widget.Class_Path (Inherited)
Gtk.Widget.Class_Path_Reversed (Inherited)
Gtk.Widget.Create_Pango_Context (Inherited)
Gtk.Widget.Create_Pango_Layout (Inherited)
Gtk.Widget.Destroy (Inherited)
Gtk.Widget.Draw (Inherited)
Gtk.Widget.Ensure_Style (Inherited)
Gtk.Widget.Error_Bell (Inherited)
Gtk.Widget.Flag_Is_Set (Inherited)
Gtk.Widget.Flags (Inherited)
Gtk.Widget.Freeze_Child_Notify (Inherited)
Gtk.Widget.Get_Allocation_Height (Inherited)
Gtk.Widget.Get_Allocation_Width (Inherited)
Gtk.Widget.Get_Allocation_X (Inherited)
Gtk.Widget.Get_Allocation_Y (Inherited)
Gtk.Widget.Get_Ancestor (Inherited)
Gtk.Widget.Get_Child_Requisition (Inherited)
Gtk.Widget.Get_Child_Visible (Inherited)
Gtk.Widget.Get_Colormap (Inherited)
Gtk.Widget.Get_Composite_Name (Inherited)
Gtk.Widget.Get_Direction (Inherited)
Gtk.Widget.Get_Events (Inherited)
Gtk.Widget.Get_Extension_Events (Inherited)
Gtk.Widget.Get_Has_Tooltip (Inherited)
Gtk.Widget.Get_Name (Inherited)
Gtk.Widget.Get_No_Show_All (Inherited)
Gtk.Widget.Get_Pango_Context (Inherited)
Gtk.Widget.Get_Parent (Inherited)
Gtk.Widget.Get_Parent_Window (Inherited)
Gtk.Widget.Get_Pointer (Inherited)
Gtk.Widget.Get_Root_Window (Inherited)
Gtk.Widget.Get_Size_Request (Inherited)
Gtk.Widget.Get_Snapshot (Inherited)
Gtk.Widget.Get_State (Inherited)
Gtk.Widget.Get_Style (Inherited)
Gtk.Widget.Get_Tooltip_Markup (Inherited)
Gtk.Widget.Get_Tooltip_Text (Inherited)
Gtk.Widget.Get_Tooltip_Window (Inherited)
Gtk.Widget.Get_Toplevel (Inherited)
Gtk.Widget.Get_Visual (Inherited)
Gtk.Widget.Get_Window (Inherited)
Gtk.Widget.Grab_Default (Inherited)
Gtk.Widget.Grab_Focus (Inherited)
Gtk.Widget.Has_Screen (Inherited)
Gtk.Widget.Hide (Inherited)
Gtk.Widget.Hide_All (Inherited)
Gtk.Widget.Input_Shape_Combine_Mask (Inherited)
Gtk.Widget.Intersect (Inherited)
Gtk.Widget.Is_Ancestor (Inherited)
Gtk.Widget.Is_Composited (Inherited)
Gtk.Widget.Is_Focus (Inherited)
Gtk.Widget.Keynav_Failed (Inherited)
Gtk.Widget.List_Mnemonic_Labels (Inherited)
Gtk.Widget.Map (Inherited)
Gtk.Widget.Mnemonic_Activate (Inherited)
Gtk.Widget.Modify_Base (Inherited)
Gtk.Widget.Modify_Bg (Inherited)
Gtk.Widget.Modify_Cursor (Inherited)
Gtk.Widget.Modify_Fg (Inherited)
Gtk.Widget.Modify_Font (Inherited)
Gtk.Widget.Modify_Text (Inherited)
Gtk.Widget.Path (Inherited)
Gtk.Widget.Path_Reversed (Inherited)
Gtk.Widget.Queue_Clear (Inherited)
Gtk.Widget.Queue_Clear_Area (Inherited)
Gtk.Widget.Queue_Draw (Inherited)
Gtk.Widget.Queue_Draw_Area (Inherited)
Gtk.Widget.Queue_Resize (Inherited)
Gtk.Widget.Queue_Resize_No_Redraw (Inherited)
Gtk.Widget.Realize (Inherited)
Gtk.Widget.Region_Intersect (Inherited)
Gtk.Widget.Remove_Accelerator (Inherited)
Gtk.Widget.Remove_Mnemonic_Label (Inherited)
Gtk.Widget.Render_Icon (Inherited)
Gtk.Widget.Reparent (Inherited)
Gtk.Widget.Reset_Rc_Styles (Inherited)
Gtk.Widget.Reset_Shapes (Inherited)
Gtk.Widget.Restore_Default_Style (Inherited)
Gtk.Widget.Send_Expose (Inherited)
Gtk.Widget.Set_Accel_Path (Inherited)
Gtk.Widget.Set_App_Paintable (Inherited)
Gtk.Widget.Set_Child_Visible (Inherited)
Gtk.Widget.Set_Colormap (Inherited)
Gtk.Widget.Set_Composite_Name (Inherited)
Gtk.Widget.Set_Direction (Inherited)
Gtk.Widget.Set_Double_Buffered (Inherited)
Gtk.Widget.Set_Events (Inherited)
Gtk.Widget.Set_Extension_Events (Inherited)
Gtk.Widget.Set_Flags (Inherited)
Gtk.Widget.Set_Has_Tooltip (Inherited)
Gtk.Widget.Set_Name (Inherited)
Gtk.Widget.Set_No_Show_All (Inherited)
Gtk.Widget.Set_Parent (Inherited)
Gtk.Widget.Set_Parent_Window (Inherited)
Gtk.Widget.Set_Redraw_On_Allocate (Inherited)
Gtk.Widget.Set_Scroll_Adjustments (Inherited)
Gtk.Widget.Set_Sensitive (Inherited)
Gtk.Widget.Set_Size_Request (Inherited)
Gtk.Widget.Set_State (Inherited)
Gtk.Widget.Set_Style (Inherited)
Gtk.Widget.Set_Tooltip_Markup (Inherited)
Gtk.Widget.Set_Tooltip_Text (Inherited)
Gtk.Widget.Set_Tooltip_Window (Inherited)
Gtk.Widget.Set_UPosition (Inherited)
Gtk.Widget.Set_USize (Inherited)
Gtk.Widget.Set_Window (Inherited)
Gtk.Widget.Shape_Combine_Mask (Inherited)
Gtk.Widget.Show (Inherited)
Gtk.Widget.Show_All (Inherited)
Gtk.Widget.Show_Now (Inherited)
Gtk.Widget.Size_Allocate (Inherited)
Gtk.Widget.Size_Request (Inherited)
Gtk.Widget.Style_Get_Property (Inherited)
Gtk.Widget.Thaw_Child_Notify (Inherited)
Gtk.Widget.Trigger_Tooltip_Query (Inherited)
Gtk.Widget.Unmap (Inherited)
Gtk.Widget.Unrealize (Inherited)
Gtk.Widget.Unset_Flags (Inherited)
Insert_Element
Insert_Space
Insert_Stock
Insert_Widget
Prepend_Element
Prepend_Item
Prepend_Space
Prepend_Widget
Remove_Space
Set_Drop_Highlight_Item
Set_Icon_Size
Set_Orientation
Set_Show_Arrow
Set_Tooltips
Unset_Icon_Size

Types

Gtk_Toolbar

type Gtk_Toolbar is access all Gtk_Toolbar_Record'Class;

Gtk_Toolbar_Child_Type

type Gtk_Toolbar_Child_Type is
     (Toolbar_Child_Space,
      Toolbar_Child_Button,
      Toolbar_Child_Togglebutton,
      Toolbar_Child_Radiobutton,
      Toolbar_Child_Widget);
This type used to be in Gtk.Enums, but is no longer used outside of the obsolescent subprograms in this package. We strongly encourage you to move your code to the new Insert API.

Constants & Global variables

Homogeneous_Property (Glib.Properties.Property_Boolean)

Homogeneous_Property : constant Glib.Properties.Property_Boolean;

Button_Relief_Property (Gtk.Enums.Property_Gtk_Relief_Style)

Button_Relief_Property    : constant Gtk.Enums.Property_Gtk_Relief_Style;

Internal_Padding_Property (Glib.Properties.Property_Int)

Internal_Padding_Property : constant Glib.Properties.Property_Int;

Space_Size_Property (Glib.Properties.Property_Int)

Space_Size_Property       : constant Glib.Properties.Property_Int;

Signal_Orientation_Changed (Glib.Signal_Name)

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

Signal_Style_Changed (Glib.Signal_Name)

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

Signal_Popup_Context_Menu (Glib.Signal_Name)

Signal_Popup_Context_Menu  : constant Glib.Signal_Name :=
                                  "popup_context_menu";

Signal_Focus_Home_Or_End (Glib.Signal_Name)

Signal_Focus_Home_Or_End   : constant Glib.Signal_Name :=
                                  "focus_home_or_end";

Signal_Move_Focus (Glib.Signal_Name)

Signal_Move_Focus          : constant Glib.Signal_Name :=
                                  "move_focus";

Subprograms & Entries

Gtk_New

procedure Gtk_New 
(Widget: out Gtk_Toolbar);

Initialize

procedure Initialize 
(Widget: access Gtk_Toolbar_Record'Class);
Create or initialize a new toolbar

Get_Type

function Get_Type return Glib.GType;
Return the internal value associated with a Gtk_Toolbar.

Insert

procedure Insert 
(Toolbar: access Gtk_Toolbar_Record;
Item: access Gtk.Tool_Item.Gtk_Tool_Item_Record'Class;
Pos: Gint := -1);
Insert a new item anywhere in the toolbar. If Pos is negative, the item is inserted at the end. If Pos is 0, the item is inserted first in the toolbar

Get_Item_Index

function Get_Item_Index 
(Toolbar: access Gtk_Toolbar_Record;
Item: access Gtk.Tool_Item.Gtk_Tool_Item_Record'Class) return Gint;
Get the position of Item within the toolbar

Get_N_Items

function Get_N_Items 
(Toolbar: access Gtk_Toolbar_Record) return Gint;
Return the number of items in the toolbar

Get_Nth_Item

function Get_Nth_Item 
(Toolbar: access Gtk_Toolbar_Record;
N: Gint) return Gtk.Tool_Item.Gtk_Tool_Item;
Return the n-th item in the toolbar

Set_Drop_Highlight_Item

procedure Set_Drop_Highlight_Item 
(Toolbar: access Gtk_Toolbar_Record;
Tool_Item: access Gtk.Tool_Item.Gtk_Tool_Item_Record'Class;
Index: Gint);
Highlights Toolbar to give an idea of what it would look like if Item was added at the position indicated by Index. If Item is %NULL, highlighting is turned off. In that case Index is ignored. The 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 be added to any widget hierarchy or used as highlight item for another toolbar.

Set_Orientation

procedure Set_Orientation 
(Toolbar: access Gtk_Toolbar_Record;
Orientation: Gtk_Orientation);

Get_Orientation

function Get_Orientation 
(Toolbar: access Gtk_Toolbar_Record) return Gtk_Orientation;
Set or get the orientation (horizontal, vertical) for the toolbar

Set_Style

procedure Set_Style 
(Toolbar: access Gtk_Toolbar_Record;
Style: Gtk_Toolbar_Style);

Get_Style

function Get_Style 
(Toolbar: access Gtk_Toolbar_Record) return Gtk_Toolbar_Style;
Set the style of the toolbar: text only, images only, or both

Unset_Style

procedure Unset_Style 
(Toolbar: access Gtk_Toolbar_Record);
Unsets a toolbar style set with Set_Style, so that user preferences will be used to determine the toolbar style. These user preferences are defined through the current gtk+ theme

Set_Tooltips

procedure Set_Tooltips 
(Toolbar: access Gtk_Toolbar_Record;
Enable: Boolean);

Get_Tooltips

function Get_Tooltips 
(Toolbar: access Gtk_Toolbar_Record) return Boolean;
Sets whether tooltips should be enabled for items in the toolbar

Get_Relief_Style

function Get_Relief_Style 
(Toolbar: access Gtk_Toolbar_Record) return Gtk_Relief_Style;
Returns the relief style of buttons on Toolbar. See Gtk.Button.Set_Relief for more information on reliefs.

Set_Show_Arrow

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

Get_Show_Arrow

function Get_Show_Arrow 
(Toolbar: access Gtk_Toolbar_Record) return Boolean;
Sets or Gets whether to show an overflow arrow when the toolbar doesn't have room for all items on it. If True, the items that have no room are still available to the user.

Get_Icon_Size

function Get_Icon_Size 
(Toolbar: access Gtk_Toolbar_Record) return Gtk_Icon_Size;
Returns the icon size used in this toolbar

Get_Drop_Index

function Get_Drop_Index 
(Toolbar: access Gtk_Toolbar_Record;
X: Gint;
Y: Gint) return 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, Y) are the coordinates, in pixels, within the toolbar

Gtk_New

procedure Gtk_New 
(Widget: out Gtk_Toolbar;
Orientation: Gtk_Orientation;
Style: Gtk_Toolbar_Style);

Initialize

procedure Initialize 
(Widget: access Gtk_Toolbar_Record'Class;
Orientation: Gtk_Orientation;
Style: Gtk_Toolbar_Style);

Append_Element

function Append_Element 
(Toolbar: access Gtk_Toolbar_Record;
The_Type: Gtk_Toolbar_Child_Type;
Widget: Gtk.Widget.Gtk_Widget := null;
Text: UTF8_String := "";
Tooltip_Text: UTF8_String := "";
Tooltip_Private_Text: UTF8_String := "";
Icon: Gtk.Widget.Gtk_Widget := null) return Gtk.Widget.Gtk_Widget;

Prepend_Element

function Prepend_Element 
(Toolbar: access Gtk_Toolbar_Record;
The_Type: Gtk_Toolbar_Child_Type;
Widget: access Gtk.Widget.Gtk_Widget_Record'Class;
Text: UTF8_String := "";
Tooltip_Text: UTF8_String := "";
Tooltip_Private_Text: UTF8_String := "";
Icon: Gtk.Widget.Gtk_Widget := null) return Gtk.Widget.Gtk_Widget;

Insert_Element

function Insert_Element 
(Toolbar: access Gtk_Toolbar_Record;
The_Type: Gtk_Toolbar_Child_Type;
Widget: access Gtk.Widget.Gtk_Widget_Record'Class;
Text: UTF8_String := "";
Tooltip_Text: UTF8_String := "";
Tooltip_Private_Text: UTF8_String := "";
Icon: Gtk.Widget.Gtk_Widget := null;
Position: Gint) return Gtk.Widget.Gtk_Widget;

Append_Item

function Append_Item 
(Toolbar: access Gtk_Toolbar_Record;
Text: UTF8_String := "";
Tooltip_Text: UTF8_String := "";
Tooltip_Private_Text: UTF8_String := "";
Icon: Gtk.Widget.Gtk_Widget := null) return Gtk.Button.Gtk_Button;

Prepend_Item

function Prepend_Item 
(Toolbar: access Gtk_Toolbar_Record;
Text: UTF8_String := "";
Tooltip_Text: UTF8_String := "";
Tooltip_Private_Text: UTF8_String := "";
Icon: Gtk.Widget.Gtk_Widget := null) return Gtk.Button.Gtk_Button;

Insert_Item

function Insert_Item 
(Toolbar: access Gtk_Toolbar_Record;
Text: UTF8_String := "";
Tooltip_Text: UTF8_String := "";
Tooltip_Private_Text: UTF8_String := "";
Icon: Gtk.Widget.Gtk_Widget := null;
Position: Gint) return Gtk.Button.Gtk_Button;

Insert_Stock

function Insert_Stock 
(Toolbar: access Gtk_Toolbar_Record;
Stock_Id: UTF8_String;
Tooltip_Text: UTF8_String := "";
Tooltip_Private_Text: UTF8_String := "";
Position: Gint := -1) return Gtk.Button.Gtk_Button;

Append_Space

procedure Append_Space 
(Toolbar: access Gtk_Toolbar_Record);

Prepend_Space

procedure Prepend_Space 
(Toolbar: access Gtk_Toolbar_Record);

Insert_Space

procedure Insert_Space 
(Toolbar: access Gtk_Toolbar_Record;
Position: Gint);

Remove_Space

procedure Remove_Space 
(Toolbar: access Gtk_Toolbar_Record;
Position: Gint);

Append_Widget

procedure Append_Widget 
(Toolbar: access Gtk_Toolbar_Record;
Widget: access Gtk.Widget.Gtk_Widget_Record'Class;
Tooltip_Text: UTF8_String := "";
Tooltip_Private_Text: UTF8_String := "");

Prepend_Widget

procedure Prepend_Widget 
(Toolbar: access Gtk_Toolbar_Record;
Widget: access Gtk.Widget.Gtk_Widget_Record'Class;
Tooltip_Text: UTF8_String := "";
Tooltip_Private_Text: UTF8_String := "");

Insert_Widget

procedure Insert_Widget 
(Toolbar: access Gtk_Toolbar_Record;
Widget: access Gtk.Widget.Gtk_Widget_Record'Class;
Tooltip_Text: UTF8_String := "";
Tooltip_Private_Text: UTF8_String := "";
Position: Gint);

Set_Icon_Size

procedure Set_Icon_Size 
(Toolbar: access Gtk_Toolbar_Record;
Icon_Size: Gtk_Icon_Size);

Unset_Icon_Size

procedure Unset_Icon_Size 
(Toolbar: access Gtk_Toolbar_Record);
Unset_Icon_Size Unsets icon sizes set through Set_Icon_Size, so that user preferences set through the gtk+ theme are used