Index

Package: Action

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

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

Ancestors:

Immediate Children:

Primitive operations:

Block_Activate
Block_Activate_From
Connect_Accelerator
Connect_Proxy
Create_Menu_Item
Create_Tool_Item
Disconnect_Accelerator
Disconnect_Proxy
Get_Accel_Path
Get_Icon_Name
Get_Is_Important
Get_Sensitive
Get_Short_Label
Get_Stock_Id
Get_Visible_Horizontal
Get_Visible_Vertical
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)
Is_Sensitive
Set_Accel_Group
Set_Accel_Path
Set_Icon_Name
Set_Is_Important
Set_Sensitive
Set_Short_Label
Set_Stock_Id
Set_Visible_Horizontal
Set_Visible_Vertical
Unblock_Activate
Unblock_Activate_From

Types

Gtk_Action

type Gtk_Action is access all Gtk_Action_Record'Class;

Constants & Global variables

Action_Group_Property (Glib.Properties.Property_Object)

Action_Group_Property       : constant Glib.Properties.Property_Object;

Hide_If_Empty_Property (Glib.Properties.Property_Boolean)

Hide_If_Empty_Property      : constant Glib.Properties.Property_Boolean;

Is_Important_Property (Glib.Properties.Property_Boolean)

Is_Important_Property       : constant Glib.Properties.Property_Boolean;

Short_Label_Property (Glib.Properties.Property_String)

Short_Label_Property        : constant Glib.Properties.Property_String;

Visible_Horizontal_Property (Glib.Properties.Property_Boolean)

Visible_Horizontal_Property : constant Glib.Properties.Property_Boolean;

Visible_Overflown_Property (Glib.Properties.Property_Boolean)

Visible_Overflown_Property  : constant Glib.Properties.Property_Boolean;

Visible_Vertical_Property (Glib.Properties.Property_Boolean)

Visible_Vertical_Property   : constant Glib.Properties.Property_Boolean;

Signal_Activate (Glib.Signal_Name)

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

Subprograms & Entries

Gtk_New

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

Initialize

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

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

function Get_Type return GType;
Return the internal value associated with a Gtk_Action

Activate

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

procedure Connect_Accelerator    
(Action: access Gtk_Action_Record);

Disconnect_Accelerator

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

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

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

Set_GIcon

procedure Set_GIcon 
(Action: access Gtk_Action_Record;
Icon: Glib.G_Icon.G_Icon);
Gets/Sets the Action's G_Icon.

Get_Icon_Name

function Get_Icon_Name 
(Action: access Gtk_Action_Record) return String;

Set_Icon_Name

procedure Set_Icon_Name 
(Action: access Gtk_Action_Record;
Icon_Name: String);
Gets/Sets the Action's icon name.

Get_Is_Important

function Get_Is_Important 
(Action: access Gtk_Action_Record) return Boolean;

Set_Is_Important

procedure Set_Is_Important 
(Action: access Gtk_Action_Record;
Is_Important: Boolean);
Gets/Sets whether or not Action is important.

Get_Label

function Get_Label 
(Action: access Gtk_Action_Record) return String;

Set_Label

procedure Set_Label 
(Action: access Gtk_Action_Record;
Label: String);
Gets/Sets the label text associated with Action.

Get_Short_Label

function Get_Short_Label 
(Action: access Gtk_Action_Record) return String;

Set_Short_Label

procedure Set_Short_Label 
(Action: access Gtk_Action_Record;
Short_Label: String);
Gets/Sets the short label text of Action.

Get_Stock_Id

function Get_Stock_Id 
(Action: access Gtk_Action_Record) return String;

Set_Stock_Id

procedure Set_Stock_Id 
(Action: access Gtk_Action_Record;
Stock_Id: String);
Gets/Sets the stock id of Action.

Get_Tooltip

function Get_Tooltip 
(Action: access Gtk_Action_Record) return String;

Set_Tooltip

procedure Set_Tooltip 
(Action: access Gtk_Action_Record;
Tooltip: String);
Gets/Sets the tooltip text associated with Action.

Get_Visible_Horizontal

function Get_Visible_Horizontal 
(Action: access Gtk_Action_Record) return Boolean;

Set_Visible_Horizontal

procedure Set_Visible_Horizontal 
(Action: access Gtk_Action_Record;
Visible_Horizontal: Boolean);
Gets/Sets whether Action is visible when horizontal.

Get_Visible_Vertical

function Get_Visible_Vertical 
(Action: access Gtk_Action_Record) return Boolean;

Set_Visible_Vertical

procedure Set_Visible_Vertical 
(Action: access Gtk_Action_Record;
Visible_Vertical: Boolean);
Gets/Sets whether Action is visible when vertical.

Create_Menu

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

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

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

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

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

Get_Accel_Path

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

function Get_Name 
(Action: access Gtk_Action_Record) return String;
Returns the name of the action.

Set_Sensitive

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

Get_Sensitive

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

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

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

Get_Visible

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

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

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

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

Connect_Proxy

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

Disconnect_Proxy

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

Block_Activate

procedure Block_Activate   
(Action: access Gtk_Action_Record);

Unblock_Activate

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

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

Unblock_Activate_From

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