## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

## Index

Package: Action

- Goto spec source

# Description

    package Gtk.Action is

Actions represent operations that the user can perform, along with some information on how it should be presented in the interface. Each action provides methods to create icons, menu items and toolbar items representing itself.

As well as the callback that is called when the action gets activated, the following also gets associated with the action: - a name (not translated, for path lookup) - a label (translated, for display) - an accelerator - whether label indicates a stock id - a tooltip (optional, translated) - a toolbar label (optional, shorter than label) The action will also have some state information: - visible (shown/hidden) - sensitive (enabled/disabled) Apart from regular actions, there are toggle actions, which can be toggled between two states and radio actions, of which only one in a group can be in the "active" state. Other actions can be implemented as Gtk_Action subclasses.

Each action can have one or more proxy menu item, toolbar button or other proxy widgets. Proxies mirror the state of the action (text label, tooltip, icon, visible, sensitive, etc), and should change when the action's state changes. When the proxy is activated, it should activate its action.

Binding from C File version 2.16.6

# Classes

### Gtk_Action_Record

- Goto declaration in source
- Goto full declaration in source

    type Gtk_Action_Record is new Glib.Object.GObject_Record with private;

#### Ancestors:

Glib.Object.GObject_Record

#### Immediate Children:

Gtk.Recent_Action.Gtk_Recent_Action_Record
Gtk.Toggle_Action.Gtk_Toggle_Action_Record

#### Primitive operations:

Activate

- To API doc
- To spec

Block_Activate

- To API doc
- To spec

Block_Activate_From

- To API doc
- To spec

Connect_Accelerator

- To API doc
- To spec

Connect_Proxy

- To API doc
- To spec

Create_Icon

- To API doc
- To spec

Create_Menu

- To API doc
- To spec

Create_Menu_Item

- To API doc
- To spec

Create_Tool_Item

- To API doc
- To spec

Disconnect_Accelerator

- To API doc
- To spec

Disconnect_Proxy

- To API doc
- To spec

Get_Accel_Path

- To API doc
- To spec

Get_GIcon

- To API doc
- To spec

Get_Icon_Name

- To API doc
- To spec

Get_Is_Important

- To API doc
- To spec

Get_Label

- To API doc
- To spec

Get_Name

- To API doc
- To spec

Get_Proxies

- To API doc
- To spec

Get_Sensitive

- To API doc
- To spec

Get_Short_Label

- To API doc
- To spec

Get_Stock_Id

- To API doc
- To spec

Get_Tooltip

- To API doc
- To spec

Get_Visible

- To API doc
- To spec

Get_Visible_Horizontal

- To API doc
- To spec

Get_Visible_Vertical

- To API doc
- To spec

Glib.Object.Deallocate

- To API doc
- To spec

(Inherited)
Glib.Object.Get_Type

- To API doc
- To spec

(Inherited)
Glib.Object.Notify

- To API doc
- To spec

(Inherited)
Glib.Object.Ref

- To API doc
- To spec

(Inherited)
Glib.Object.Ref_Sink

- To API doc
- To spec

(Inherited)
Glib.Object.Unref

- To API doc
- To spec

(Inherited)
Is_Sensitive

- To API doc
- To spec

Is_Visible

- To API doc
- To spec

Set_Accel_Group

- To API doc
- To spec

Set_Accel_Path

- To API doc
- To spec

Set_GIcon

- To API doc
- To spec

Set_Icon_Name

- To API doc
- To spec

Set_Is_Important

- To API doc
- To spec

Set_Label

- To API doc
- To spec

Set_Sensitive

- To API doc
- To spec

Set_Short_Label

- To API doc
- To spec

Set_Stock_Id

- To API doc
- To spec

Set_Tooltip

- To API doc
- To spec

Set_Visible

- To API doc
- To spec

Set_Visible_Horizontal

- To API doc
- To spec

Set_Visible_Vertical

- To API doc
- To spec

Unblock_Activate

- To API doc
- To spec

Unblock_Activate_From

- To API doc
- To spec

# Types

### Gtk_Action

- Goto declaration in source

    type Gtk_Action is access all Gtk_Action_Record'Class;

# Constants & Global variables

### Action_Group_Property

- Goto declaration in source

(Glib.Properties.Property_Object)

    Action_Group_Property       : constant Glib.Properties.Property_Object;

### GIcon_Property

- Goto declaration in source

(Glib.Properties.Property_Object)

    GIcon_Property              : constant Glib.Properties.Property_Object;

### Hide_If_Empty_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Hide_If_Empty_Property      : constant Glib.Properties.Property_Boolean;

### Icon_Name_Property

- Goto declaration in source

(Glib.Properties.Property_String)

    Icon_Name_Property          : constant Glib.Properties.Property_String;

### Is_Important_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Is_Important_Property       : constant Glib.Properties.Property_Boolean;

### Label_Property

- Goto declaration in source

(Glib.Properties.Property_String)

    Label_Property              : constant Glib.Properties.Property_String;

### Name_Property

- Goto declaration in source

(Glib.Properties.Property_String)

    Name_Property               : constant Glib.Properties.Property_String;

### Sensitive_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Sensitive_Property          : constant Glib.Properties.Property_Boolean;

### Short_Label_Property

- Goto declaration in source

(Glib.Properties.Property_String)

    Short_Label_Property        : constant Glib.Properties.Property_String;

### Stock_Id_Property

- Goto declaration in source

(Glib.Properties.Property_String)

    Stock_Id_Property           : constant Glib.Properties.Property_String;

### Tooltip_Property

- Goto declaration in source

(Glib.Properties.Property_String)

    Tooltip_Property            : constant Glib.Properties.Property_String;

### Visible_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Visible_Property            : constant Glib.Properties.Property_Boolean;

### Visible_Horizontal_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Visible_Horizontal_Property : constant Glib.Properties.Property_Boolean;

### Visible_Overflown_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Visible_Overflown_Property  : constant Glib.Properties.Property_Boolean;

### Visible_Vertical_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Visible_Vertical_Property   : constant Glib.Properties.Property_Boolean;

### Signal_Activate

- Goto declaration in source

(Glib.Signal_Name)

    Signal_Activate : constant Glib.Signal_Name := "activate";

# Subprograms & Entries

### Gtk_New

- Goto spec in source

    procedure Gtk_New (Action: out Gtk_Action;Name: String;Label: String;Tooltip: String := "";Stock_Id: String := "");

### Initialize

- Goto spec in source

    procedure Initialize (Action: access Gtk_Action_Record'Class;Name: String;Label: String;Tooltip: String := "";Stock_Id: String := "");

Creates a new Gtk_Action object. To add the action to a Gtk_Action_Group and set the accelerator for the action, call Gtk.Action_Group.Add_Action_With_Accel. Name must be a unique name for the action. Label is the label displayed in menu items and on buttons.

### Convert

- Goto spec in source

    function Convert (C_Object: System.Address) return Gtk_Action;

Convert a C object to a Gtk_Action. The type of the C object must match, of course.

### Get_Type

- Goto spec in source
- Goto body in source

    function Get_Type return GType;

Return the internal value associated with a Gtk_Action

### Activate

- Goto spec in source

    procedure Activate (Action: access Gtk_Action_Record);

Emits the "activate" signal on the specified action, if it isn't insensitive. This gets called by the proxy widgets when they get activated. It can also be used to manually activate an action.

### Connect_Accelerator

- Goto spec in source

    procedure Connect_Accelerator    (Action: access Gtk_Action_Record);

### Disconnect_Accelerator

- Goto spec in source

    procedure Disconnect_Accelerator (Action: access Gtk_Action_Record);

Installs the accelerator for Action if Action has an accel path and group. See Set_Accel_Path and Set_Accel_Group. Since multiple proxies may independently trigger the installation of the accelerator, the Action counts the number of times this function has been called and doesn't remove the accelerator until Disconnect_Accelerator has been called as many times.

### Create_Icon

- Goto spec in source

    function Create_Icon (Action: access Gtk_Action_Record;Icon_Size: Gtk.Enums.Gtk_Icon_Size) return Gtk.Widget.Gtk_Widget;

This function is intended for use by action implementations to create icons displayed in the proxy widgets. Returns a widget that displays the icon for this action.

### Get_GIcon

- Goto spec in source

    function Get_GIcon (Action: access Gtk_Action_Record) return Glib.G_Icon.G_Icon;

### Set_GIcon

- Goto spec in source

    procedure Set_GIcon (Action: access Gtk_Action_Record;Icon: Glib.G_Icon.G_Icon);

Gets/Sets the Action's G_Icon.

### Get_Icon_Name

- Goto spec in source

    function Get_Icon_Name (Action: access Gtk_Action_Record) return String;

### Set_Icon_Name

- Goto spec in source

    procedure Set_Icon_Name (Action: access Gtk_Action_Record;Icon_Name: String);

Gets/Sets the Action's icon name.

### Get_Is_Important

- Goto spec in source

    function Get_Is_Important (Action: access Gtk_Action_Record) return Boolean;

### Set_Is_Important

- Goto spec in source

    procedure Set_Is_Important (Action: access Gtk_Action_Record;Is_Important: Boolean);

Gets/Sets whether or not Action is important.

### Get_Label

- Goto spec in source

    function Get_Label (Action: access Gtk_Action_Record) return String;

### Set_Label

- Goto spec in source

    procedure Set_Label (Action: access Gtk_Action_Record;Label: String);

Gets/Sets the label text associated with Action.

### Get_Short_Label

- Goto spec in source

    function Get_Short_Label (Action: access Gtk_Action_Record) return String;

### Set_Short_Label

- Goto spec in source

    procedure Set_Short_Label (Action: access Gtk_Action_Record;Short_Label: String);

Gets/Sets the short label text of Action.

### Get_Stock_Id

- Goto spec in source

    function Get_Stock_Id (Action: access Gtk_Action_Record) return String;

### Set_Stock_Id

- Goto spec in source

    procedure Set_Stock_Id (Action: access Gtk_Action_Record;Stock_Id: String);

Gets/Sets the stock id of Action.

### Get_Tooltip

- Goto spec in source

    function Get_Tooltip (Action: access Gtk_Action_Record) return String;

### Set_Tooltip

- Goto spec in source

    procedure Set_Tooltip (Action: access Gtk_Action_Record;Tooltip: String);

Gets/Sets the tooltip text associated with Action.

### Get_Visible_Horizontal

- Goto spec in source

    function Get_Visible_Horizontal (Action: access Gtk_Action_Record) return Boolean;

### Set_Visible_Horizontal

- Goto spec in source

    procedure Set_Visible_Horizontal (Action: access Gtk_Action_Record;Visible_Horizontal: Boolean);

Gets/Sets whether Action is visible when horizontal.

### Get_Visible_Vertical

- Goto spec in source

    function Get_Visible_Vertical (Action: access Gtk_Action_Record) return Boolean;

### Set_Visible_Vertical

- Goto spec in source

    procedure Set_Visible_Vertical (Action: access Gtk_Action_Record;Visible_Vertical: Boolean);

Gets/Sets whether Action is visible when vertical.

### Create_Menu

- Goto spec in source

    function Create_Menu (Action: access Gtk_Action_Record) return Gtk.Widget.Gtk_Widget;

If Action provides a Gtk_Menu widget as a submenu for the menu item or the toolbar item it creates, this function returns an instance of that menu. Since: 2.12

### Create_Menu_Item

- Goto spec in source

    function Create_Menu_Item (Action: access Gtk_Action_Record) return Gtk.Widget.Gtk_Widget;

Creates a menu item widget that proxies for the given action.

### Create_Tool_Item

- Goto spec in source

    function Create_Tool_Item (Action: access Gtk_Action_Record) return Gtk.Widget.Gtk_Widget;

Creates a toolbar item widget that proxies for the given action.

### Set_Accel_Group

- Goto spec in source

    procedure Set_Accel_Group (Action: access Gtk_Action_Record;Accel_Group: Gtk.Accel_Group.Gtk_Accel_Group := null);

Sets the Gtk_Accel_Group in which the accelerator for this action will be installed.

### Set_Accel_Path

- Goto spec in source

    procedure Set_Accel_Path (Action: access Gtk_Action_Record;Accel_Path: String);

### Get_Accel_Path

- Goto spec in source

    function Get_Accel_Path (Action: access Gtk_Action_Record) return String;

Sets the accel path for this action. All proxy widgets associated with the action will have this accel path, so that their accelerators are consistent.

### Get_Name

- Goto spec in source

    function Get_Name (Action: access Gtk_Action_Record) return String;

Returns the name of the action.

### Set_Sensitive

- Goto spec in source

    procedure Set_Sensitive (Action: access Gtk_Action_Record;Sensitive: Boolean);

### Get_Sensitive

- Goto spec in source

    function Get_Sensitive (Action: access Gtk_Action_Record) return Boolean;

Returns whether the action itself is sensitive. Note that this doesn't necessarily mean effective sensitivity. See Is_Sensitive for that.

### Is_Sensitive

- Goto spec in source

    function Is_Sensitive (Action: access Gtk_Action_Record) return Boolean;

Returns whether the action is effectively sensitive. Returns True if teh action and its associated action group are both sensitive.

### Set_Visible

- Goto spec in source

    procedure Set_Visible (Action: access Gtk_Action_Record;Visible: Boolean);

### Get_Visible

- Goto spec in source

    function Get_Visible (Action: access Gtk_Action_Record) return Boolean;

Returns whether the action itself is visible. Note that this doesn't necessarily mean effective visibility. See Is_Visible for that.

### Is_Visible

- Goto spec in source

    function Is_Visible (Action: access Gtk_Action_Record) return Boolean;

Returns whether the action is effectively visible. Returns True if the action and its associated action group are both visible.

### Get_Proxies

- Goto spec in source

    function Get_Proxies (Action: access Gtk_Action_Record) return Gtk.Widget.Widget_SList.GSlist;

Returns the proxy widgets for an action. The returned list must not be modified

### Gtk_Widget_Get_Action

- Goto spec in source

    function Gtk_Widget_Get_Action (Widget: access Gtk.Widget.Gtk_Widget_Record) return Gtk_Action;

### Connect_Proxy

- Goto spec in source

    procedure Connect_Proxy (Action: access Gtk_Action_Record;Proxy: access Gtk.Widget.Gtk_Widget_Record'Class);

### Disconnect_Proxy

- Goto spec in source

    procedure Disconnect_Proxy (Action: access Gtk_Action_Record;Proxy: access Gtk.Widget.Gtk_Widget_Record'Class);

### Block_Activate

- Goto spec in source

    procedure Block_Activate   (Action: access Gtk_Action_Record);

### Unblock_Activate

- Goto spec in source

    procedure Unblock_Activate (Action: access Gtk_Action_Record);

Disable or reenable activation signals from the action. This is needed when updating the state of your proxy widget could result in calling Activate. This is a convenience function to avoid recursing in those cases (updating toggle state for instance).

### Block_Activate_From

- Goto spec in source

    procedure Block_Activate_From (Action: access Gtk_Action_Record;Proxy: access Gtk.Widget.Gtk_Widget_Record'Class);

### Unblock_Activate_From

- Goto spec in source

    procedure Unblock_Activate_From (Action: access Gtk_Action_Record;Proxy: access Gtk.Widget.Gtk_Widget_Record'Class);