Gtk.Tool_Item

Entities

Tagged Types

Access Types

Constants

Subprograms

Generic Instantiations

Description

Gtk_Tool_Items are widgets that can appear on a toolbar. To create a toolbar item that contain something else than a button, use Gtk.Tool_Item.Gtk_New. Use Gtk.Container.Add to add a child widget to the tool item.

For toolbar items that contain buttons, see the Gtk.Tool_Button.Gtk_Tool_Button, Gtk.Toggle_Tool_Button.Gtk_Toggle_Tool_Button and Gtk.Radio_Tool_Button.Gtk_Radio_Tool_Button classes.

See the Gtk.Toolbar.Gtk_Toolbar class for a description of the toolbar widget, and Gtk.Tool_Shell.Gtk_Tool_Shell for a description of the tool shell interface.

"+"

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

"+"

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

"-"

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

"-"

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

Cb_GObject_Boolean

type Cb_GObject_Boolean is not null access function
  (Self : access Glib.Object.GObject_Record'Class)
return Boolean;
Parameters
Self
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_Item_Boolean

type Cb_Gtk_Tool_Item_Boolean is not null access function
  (Self : access Gtk_Tool_Item_Record'Class) return Boolean;
Parameters
Self
Return Value

Cb_Gtk_Tool_Item_Void

type Cb_Gtk_Tool_Item_Void is not null access procedure (Self : access Gtk_Tool_Item_Record'Class);
Parameters
Self

Do_Set_Related_Action

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

Get_Ellipsize_Mode

function Get_Ellipsize_Mode
   (Tool_Item : not null access Gtk_Tool_Item_Record)
    return Pango.Layout.Pango_Ellipsize_Mode

Returns the ellipsize mode used for Tool_Item. Custom subclasses of Gtk.Tool_Item.Gtk_Tool_Item should call this function to find out how text should be ellipsized. Since: gtk+ 2.20

Parameters
Tool_Item
Return Value

a Pango.Layout.Pango_Ellipsize_Mode indicating how text in Tool_Item should be ellipsized.

Get_Expand

function Get_Expand
   (Tool_Item : not null access Gtk_Tool_Item_Record) return Boolean

Returns whether Tool_Item is allocated extra space. See Gtk.Tool_Item.Set_Expand. Since: gtk+ 2.4

Parameters
Tool_Item
Return Value

True if Tool_Item is allocated extra space.

Get_Homogeneous

function Get_Homogeneous
   (Tool_Item : not null access Gtk_Tool_Item_Record) return Boolean

Returns whether Tool_Item is the same size as other homogeneous items. See Gtk.Tool_Item.Set_Homogeneous. Since: gtk+ 2.4

Parameters
Tool_Item
Return Value

True if the item is the same size as other homogeneous items.

Get_Icon_Size

function Get_Icon_Size
   (Tool_Item : not null access Gtk_Tool_Item_Record)
    return Gtk.Enums.Gtk_Icon_Size

Returns the icon size used for Tool_Item. Custom subclasses of Gtk.Tool_Item.Gtk_Tool_Item should call this function to find out what size icons they should use. Since: gtk+ 2.4

Parameters
Tool_Item
Return Value

a Gtk.Enums.Gtk_Icon_Size indicating the icon size used for Tool_Item

Get_Is_Important

function Get_Is_Important
   (Tool_Item : not null access Gtk_Tool_Item_Record) return Boolean

Returns whether Tool_Item is considered important. See Gtk.Tool_Item.Set_Is_Important Since: gtk+ 2.4

Parameters
Tool_Item
Return Value

True if Tool_Item is considered important.

Get_Orientation

function Get_Orientation
   (Tool_Item : not null access Gtk_Tool_Item_Record)
    return Gtk.Enums.Gtk_Orientation

Returns the orientation used for Tool_Item. Custom subclasses of Gtk.Tool_Item.Gtk_Tool_Item should call this function to find out what size icons they should use. Since: gtk+ 2.4

Parameters
Tool_Item
Return Value

a Gtk.Enums.Gtk_Orientation indicating the orientation used for Tool_Item

Get_Proxy_Menu_Item

function Get_Proxy_Menu_Item
   (Tool_Item    : not null access Gtk_Tool_Item_Record;
    Menu_Item_Id : UTF8_String) return Gtk.Menu_Item.Gtk_Menu_Item

If Menu_Item_Id matches the string passed to Gtk.Tool_Item.Set_Proxy_Menu_Item return the corresponding Gtk.Menu_Item.Gtk_Menu_Item. Custom subclasses of Gtk.Tool_Item.Gtk_Tool_Item should use this function to update their menu item when the Gtk.Tool_Item.Gtk_Tool_Item changes. That the Menu_Item_Ids must match ensures that a Gtk.Tool_Item.Gtk_Tool_Item will not inadvertently change a menu item that they did not create. Since: gtk+ 2.4

Parameters
Tool_Item
Menu_Item_Id

a string used to identify the menu item

Return Value

Get_Related_Action

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

Get_Relief_Style

function Get_Relief_Style
   (Tool_Item : not null access Gtk_Tool_Item_Record)
    return Gtk.Enums.Gtk_Relief_Style

Returns the relief style of Tool_Item. See Gtk.Button.Set_Relief. Custom subclasses of Gtk.Tool_Item.Gtk_Tool_Item should call this function in the handler of the Gtk.Tool_Item.Gtk_Tool_Item::toolbar_reconfigured signal to find out the relief style of buttons. Since: gtk+ 2.4

Parameters
Tool_Item
Return Value

a Gtk.Enums.Gtk_Relief_Style indicating the relief style used for Tool_Item.

Get_Text_Alignment

function Get_Text_Alignment
   (Tool_Item : not null access Gtk_Tool_Item_Record) return Gfloat

Returns the text alignment used for Tool_Item. Custom subclasses of Gtk.Tool_Item.Gtk_Tool_Item should call this function to find out how text should be aligned. Since: gtk+ 2.20

Parameters
Tool_Item
Return Value

a Gfloat indicating the horizontal text alignment used for Tool_Item

Get_Text_Orientation

function Get_Text_Orientation
   (Tool_Item : not null access Gtk_Tool_Item_Record)
    return Gtk.Enums.Gtk_Orientation

Returns the text orientation used for Tool_Item. Custom subclasses of Gtk.Tool_Item.Gtk_Tool_Item should call this function to find out how text should be orientated. Since: gtk+ 2.20

Parameters
Tool_Item
Return Value

a Gtk.Enums.Gtk_Orientation indicating the text orientation used for Tool_Item

Get_Text_Size_Group

function Get_Text_Size_Group
   (Tool_Item : not null access Gtk_Tool_Item_Record)
    return Gtk.Size_Group.Gtk_Size_Group

Returns the size group used for labels in Tool_Item. Custom subclasses of Gtk.Tool_Item.Gtk_Tool_Item should call this function and use the size group for labels. Since: gtk+ 2.20

Parameters
Tool_Item
Return Value

a Gtk.Size_Group.Gtk_Size_Group

Get_Toolbar_Style

function Get_Toolbar_Style
   (Tool_Item : not null access Gtk_Tool_Item_Record)
    return Gtk.Enums.Gtk_Toolbar_Style

Returns the toolbar style used for Tool_Item. Custom subclasses of Gtk.Tool_Item.Gtk_Tool_Item 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 Possibilities are: - Gtk.Enums.Toolbar_Both, meaning the tool item should show both an icon and a label, stacked vertically - Gtk.Enums.Toolbar_Icons, meaning the toolbar shows only icons - Gtk.Enums.Toolbar_Text, meaning the tool item should only show text - Gtk.Enums.Toolbar_Both_Horiz, meaning the tool item should show both an icon and a label, arranged horizontally Since: gtk+ 2.4

Parameters
Tool_Item
Return Value

A Gtk.Enums.Gtk_Toolbar_Style indicating the toolbar style used for Tool_Item.

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_Item_Record) return Boolean
Parameters
Self
Return Value

Get_Use_Drag_Window

function Get_Use_Drag_Window
   (Tool_Item : not null access Gtk_Tool_Item_Record) return Boolean

Returns whether Tool_Item has a drag window. See Gtk.Tool_Item.Set_Use_Drag_Window. Since: gtk+ 2.4

Parameters
Tool_Item
Return Value

True if Tool_Item uses a drag window.

Get_Visible_Horizontal

function Get_Visible_Horizontal
   (Tool_Item : not null access Gtk_Tool_Item_Record) return Boolean

Returns whether the Tool_Item is visible on toolbars that are docked horizontally. Since: gtk+ 2.4

Parameters
Tool_Item
Return Value

True if Tool_Item is visible on toolbars that are docked horizontally.

Get_Visible_Vertical

function Get_Visible_Vertical
   (Tool_Item : not null access Gtk_Tool_Item_Record) return Boolean

Returns whether Tool_Item is visible when the toolbar is docked vertically. See Gtk.Tool_Item.Set_Visible_Vertical. Since: gtk+ 2.4

Parameters
Tool_Item
Return Value

Whether Tool_Item is visible when the toolbar is docked vertically

Gtk_New

procedure Gtk_New (Tool_Item : out Gtk_Tool_Item)

Creates a new Gtk.Tool_Item.Gtk_Tool_Item Since: gtk+ 2.4 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Tool_Item

Gtk_Tool_Item

type Gtk_Tool_Item is access all Gtk_Tool_Item_Record'Class;

Gtk_Tool_Item_New

function Gtk_Tool_Item_New return Gtk_Tool_Item

Creates a new Gtk.Tool_Item.Gtk_Tool_Item Since: gtk+ 2.4

Return Value

Gtk_Tool_Item_Record

type Gtk_Tool_Item_Record is new Gtk_Bin_Record with null record;

Implements_Gtk_Activatable

package Implements_Gtk_Activatable is new Glib.Types.Implements
  (Gtk.Activatable.Gtk_Activatable, Gtk_Tool_Item_Record, Gtk_Tool_Item);

Implements_Gtk_Buildable

package Implements_Gtk_Buildable is new Glib.Types.Implements
  (Gtk.Buildable.Gtk_Buildable, Gtk_Tool_Item_Record, Gtk_Tool_Item);

Initialize

procedure Initialize
   (Tool_Item : not null access Gtk_Tool_Item_Record'Class)

Creates a new Gtk.Tool_Item.Gtk_Tool_Item Since: gtk+ 2.4 Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Tool_Item

Is_Important_Property

Is_Important_Property : constant Glib.Properties.Property_Boolean;

On_Create_Menu_Proxy

procedure On_Create_Menu_Proxy
   (Self  : not null access Gtk_Tool_Item_Record;
    Call  : Cb_GObject_Boolean;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

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

True to indicate that the item should not appear in the overflow menu

return True, or

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.

Callback parameters:

Parameters
Self
Call
Slot
After

On_Create_Menu_Proxy

procedure On_Create_Menu_Proxy
   (Self  : not null access Gtk_Tool_Item_Record;
    Call  : Cb_Gtk_Tool_Item_Boolean;
    After : Boolean := False)

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

True to indicate that the item should not appear in the overflow menu

return True, or

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.

Callback parameters:

Parameters
Self
Call
After

On_Toolbar_Reconfigured

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

This signal is emitted when some property of the toolbar that the item is a child of changes. For custom subclasses of Gtk.Tool_Item.Gtk_Tool_Item, 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.

Parameters
Self
Call
Slot
After

On_Toolbar_Reconfigured

procedure On_Toolbar_Reconfigured
   (Self  : not null access Gtk_Tool_Item_Record;
    Call  : Cb_Gtk_Tool_Item_Void;
    After : Boolean := False)

This signal is emitted when some property of the toolbar that the item is a child of changes. For custom subclasses of Gtk.Tool_Item.Gtk_Tool_Item, 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.

Parameters
Self
Call
After

Rebuild_Menu

procedure Rebuild_Menu (Tool_Item : not null access Gtk_Tool_Item_Record)

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 Gtk.Tool_Item.Gtk_Tool_Item::create-menu-proxy signal. Since: gtk+ 2.6

Parameters
Tool_Item

Retrieve_Proxy_Menu_Item

function Retrieve_Proxy_Menu_Item
   (Tool_Item : not null access Gtk_Tool_Item_Record)
    return Gtk.Menu_Item.Gtk_Menu_Item

Returns the Gtk.Menu_Item.Gtk_Menu_Item that was last set by Gtk.Tool_Item.Set_Proxy_Menu_Item, ie. the Gtk.Menu_Item.Gtk_Menu_Item that is going to appear in the overflow menu. Since: gtk+ 2.4

Parameters
Tool_Item
Return Value

Set_Expand

procedure Set_Expand
   (Tool_Item : not null access Gtk_Tool_Item_Record;
    Expand    : Boolean)

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

Parameters
Tool_Item
Expand

Whether Tool_Item is allocated extra space

Set_Homogeneous

procedure Set_Homogeneous
   (Tool_Item   : not null access Gtk_Tool_Item_Record;
    Homogeneous : Boolean)

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

Parameters
Tool_Item
Homogeneous

whether Tool_Item is the same size as other homogeneous items

Set_Is_Important

procedure Set_Is_Important
   (Tool_Item    : not null access Gtk_Tool_Item_Record;
    Is_Important : Boolean)

Sets whether Tool_Item should be considered important. The Gtk.Tool_Button.Gtk_Tool_Button class uses this property to determine whether to show or hide its label when the toolbar style is Gtk.Enums.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: gtk+ 2.4

Parameters
Tool_Item
Is_Important

whether the tool item should be considered important

Set_Proxy_Menu_Item

procedure Set_Proxy_Menu_Item
   (Tool_Item    : not null access Gtk_Tool_Item_Record;
    Menu_Item_Id : UTF8_String;
    Menu_Item    : access Gtk.Menu_Item.Gtk_Menu_Item_Record'Class)

Sets the Gtk.Menu_Item.Gtk_Menu_Item 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. See also Gtk.Tool_Item.Gtk_Tool_Item::create-menu-proxy. Since: gtk+ 2.4

Parameters
Tool_Item
Menu_Item_Id

a string used to identify Menu_Item

Menu_Item

a Gtk.Menu_Item.Gtk_Menu_Item to use in the overflow menu, or null

Set_Related_Action

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

Set_Tooltip_Markup

procedure Set_Tooltip_Markup
   (Tool_Item : not null access Gtk_Tool_Item_Record;
    Markup    : UTF8_String)

Sets the markup text to be displayed as tooltip on the item. See Gtk.Widget.Set_Tooltip_Markup. Since: gtk+ 2.12

Parameters
Tool_Item
Markup

markup text to be used as tooltip for Tool_Item

Set_Tooltip_Text

procedure Set_Tooltip_Text
   (Tool_Item : not null access Gtk_Tool_Item_Record;
    Text      : UTF8_String)

Sets the text to be displayed as tooltip on the item. See Gtk.Widget.Set_Tooltip_Text. Since: gtk+ 2.12

Parameters
Tool_Item
Text

text to be used as tooltip for Tool_Item

Set_Use_Action_Appearance

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

Set_Use_Drag_Window

procedure Set_Use_Drag_Window
   (Tool_Item       : not null access Gtk_Tool_Item_Record;
    Use_Drag_Window : Boolean)

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

Parameters
Tool_Item
Use_Drag_Window

Whether Tool_Item has a drag window.

Set_Visible_Horizontal

procedure Set_Visible_Horizontal
   (Tool_Item          : not null access Gtk_Tool_Item_Record;
    Visible_Horizontal : Boolean)

Sets whether Tool_Item is visible when the toolbar is docked horizontally. Since: gtk+ 2.4

Parameters
Tool_Item
Visible_Horizontal

Whether Tool_Item is visible when in horizontal mode

Set_Visible_Vertical

procedure Set_Visible_Vertical
   (Tool_Item        : not null access Gtk_Tool_Item_Record;
    Visible_Vertical : Boolean)

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

Parameters
Tool_Item
Visible_Vertical

whether Tool_Item is visible when the toolbar is in vertical mode

Signal_Create_Menu_Proxy

Signal_Create_Menu_Proxy : constant Glib.Signal_Name := "create-menu-proxy";

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

True to indicate that the item should not appear in the overflow menu

return True, or

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.

Callback parameters:

Signal_Toolbar_Reconfigured

Signal_Toolbar_Reconfigured : constant Glib.Signal_Name := "toolbar-reconfigured";

This signal is emitted when some property of the toolbar that the item is a child of changes. For custom subclasses of Gtk.Tool_Item.Gtk_Tool_Item, 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.

Sync_Action_Properties

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

Toolbar_Reconfigured

procedure Toolbar_Reconfigured
   (Tool_Item : not null access Gtk_Tool_Item_Record)

Emits the signal Gtk.Tool_Item.Gtk_Tool_Item::toolbar_reconfigured on Tool_Item. Gtk.Toolbar.Gtk_Toolbar and other Gtk.Tool_Shell.Gtk_Tool_Shell implementations use this function to notify children, when some aspect of their configuration changes. Since: gtk+ 2.14

Parameters
Tool_Item

Visible_Horizontal_Property

Visible_Horizontal_Property : constant Glib.Properties.Property_Boolean;

Visible_Vertical_Property

Visible_Vertical_Property : constant Glib.Properties.Property_Boolean;