package Implements_Gtk_Buildable is new Glib.Types.Implements (Gtk.Buildable.Gtk_Buildable, Gtk_Action_Record, Gtk_Action);
type Gtk_Action_Record is new GObject_Record with null record;
type Gtk_Action is access all Gtk_Action_Record'Class;
type Cb_Gtk_Action_Void is not null access procedure (Self : access Gtk_Action_Record'Class);
type Cb_GObject_Void is not null access procedure (Self : access Glib.Object.GObject_Record'Class);
Action_Group_Property : constant Glib.Properties.Property_Object;
Always_Show_Image_Property : constant Glib.Properties.Property_Boolean;
G_Icon_Property : constant Glib.Properties.Property_Boxed;
Hide_If_Empty_Property : constant Glib.Properties.Property_Boolean;
Icon_Name_Property : constant Glib.Properties.Property_String;
Is_Important_Property : constant Glib.Properties.Property_Boolean;
Label_Property : constant Glib.Properties.Property_String;
Name_Property : constant Glib.Properties.Property_String;
Sensitive_Property : constant Glib.Properties.Property_Boolean;
Short_Label_Property : constant Glib.Properties.Property_String;
Stock_Id_Property : constant Glib.Properties.Property_String;
Tooltip_Property : constant Glib.Properties.Property_String;
Visible_Property : constant Glib.Properties.Property_Boolean;
Visible_Horizontal_Property : constant Glib.Properties.Property_Boolean;
Visible_Overflown_Property : constant Glib.Properties.Property_Boolean;
Visible_Vertical_Property : constant Glib.Properties.Property_Boolean;
Signal_Activate : constant Glib.Signal_Name := "activate";
procedure Gtk_New
( | Action | : out Gtk_Action; |
Name | : UTF8_String; | |
Label | : UTF8_String := ""; | |
Tooltip | : UTF8_String := ""; | |
Stock_Id | : UTF8_String := ""); |
procedure Initialize
( | Action | : not null access Gtk_Action_Record'Class; |
Name | : UTF8_String; | |
Label | : UTF8_String := ""; | |
Tooltip | : UTF8_String := ""; | |
Stock_Id | : UTF8_String := ""); |
function Gtk_Action_New
( | Name | : UTF8_String; |
Label | : UTF8_String := ""; | |
Tooltip | : UTF8_String := ""; | |
Stock_Id | : UTF8_String := "") return Gtk_Action; |
function Get_Type return Glib.GType;
procedure Activate
( | Action | : not null access Gtk_Action_Record); |
procedure Block_Activate
( | Action | : not null access Gtk_Action_Record); |
procedure Connect_Accelerator
( | Action | : not null access Gtk_Action_Record); |
function Create_Icon
( | Action | : not null access Gtk_Action_Record; |
Icon_Size | : Gtk.Enums.Gtk_Icon_Size) return Gtk.Widget.Gtk_Widget; |
function Create_Menu
( | Action | : not null access Gtk_Action_Record) return Gtk.Widget.Gtk_Widget; |
function Create_Menu_Item
( | Action | : not null access Gtk_Action_Record) return Gtk.Widget.Gtk_Widget; |
function Create_Tool_Item
( | Action | : not null access Gtk_Action_Record) return Gtk.Widget.Gtk_Widget; |
procedure Disconnect_Accelerator
( | Action | : not null access Gtk_Action_Record); |
function Get_Accel_Path
( | Action | : not null access Gtk_Action_Record) return UTF8_String; |
procedure Set_Accel_Path
( | Action | : not null access Gtk_Action_Record; |
Accel_Path | : UTF8_String); |
function Get_Always_Show_Image
( | Action | : not null access Gtk_Action_Record) return Boolean; |
procedure Set_Always_Show_Image
( | Action | : not null access Gtk_Action_Record; |
Always_Show | : Boolean); |
function Get_Gicon
( | Action | : not null access Gtk_Action_Record) return Glib.G_Icon.G_Icon; |
procedure Set_Gicon
( | Action | : not null access Gtk_Action_Record; |
Icon | : Glib.G_Icon.G_Icon); |
function Get_Icon_Name
( | Action | : not null access Gtk_Action_Record) return UTF8_String; |
procedure Set_Icon_Name
( | Action | : not null access Gtk_Action_Record; |
Icon_Name | : UTF8_String); |
function Get_Is_Important
( | Action | : not null access Gtk_Action_Record) return Boolean; |
procedure Set_Is_Important
( | Action | : not null access Gtk_Action_Record; |
Is_Important | : Boolean); |
function Get_Label
( | Action | : not null access Gtk_Action_Record) return UTF8_String; |
procedure Set_Label
( | Action | : not null access Gtk_Action_Record; |
Label | : UTF8_String); |
function Get_Name
( | Action | : not null access Gtk_Action_Record) return UTF8_String; |
function Get_Proxies
( | Action | : not null access Gtk_Action_Record) return Gtk.Widget.Widget_SList.GSlist; |
function Get_Sensitive
( | Action | : not null access Gtk_Action_Record) return Boolean; |
procedure Set_Sensitive
( | Action | : not null access Gtk_Action_Record; |
Sensitive | : Boolean); |
function Get_Short_Label
( | Action | : not null access Gtk_Action_Record) return UTF8_String; |
procedure Set_Short_Label
( | Action | : not null access Gtk_Action_Record; |
Short_Label | : UTF8_String); |
function Get_Stock_Id
( | Action | : not null access Gtk_Action_Record) return UTF8_String; |
procedure Set_Stock_Id
( | Action | : not null access Gtk_Action_Record; |
Stock_Id | : UTF8_String); |
function Get_Tooltip
( | Action | : not null access Gtk_Action_Record) return UTF8_String; |
procedure Set_Tooltip
( | Action | : not null access Gtk_Action_Record; |
Tooltip | : UTF8_String); |
function Get_Visible
( | Action | : not null access Gtk_Action_Record) return Boolean; |
procedure Set_Visible
( | Action | : not null access Gtk_Action_Record; |
Visible | : Boolean); |
function Get_Visible_Horizontal
( | Action | : not null access Gtk_Action_Record) return Boolean; |
procedure Set_Visible_Horizontal
( | Action | : not null access Gtk_Action_Record; |
Visible_Horizontal | : Boolean); |
function Get_Visible_Vertical
( | Action | : not null access Gtk_Action_Record) return Boolean; |
procedure Set_Visible_Vertical
( | Action | : not null access Gtk_Action_Record; |
Visible_Vertical | : Boolean); |
function Is_Sensitive
( | Action | : not null access Gtk_Action_Record) return Boolean; |
function Is_Visible
( | Action | : not null access Gtk_Action_Record) return Boolean; |
procedure Set_Accel_Group
( | Action | : not null access Gtk_Action_Record; |
Accel_Group | : access Gtk.Accel_Group.Gtk_Accel_Group_Record'Class); |
procedure Unblock_Activate
( | Action | : not null access Gtk_Action_Record); |
procedure On_Activate
( | Self | : not null access Gtk_Action_Record; |
Call | : Cb_Gtk_Action_Void; | |
After | : Boolean := False); |
procedure On_Activate
( | Self | : not null access Gtk_Action_Record; |
Call | : Cb_GObject_Void; | |
Slot | : not null access Glib.Object.GObject_Record'Class; | |
After | : Boolean := False); |
function "+"
( | Widget | : access Gtk_Action_Record'Class) return Gtk.Buildable.Gtk_Buildable renames Implements_Gtk_Buildable.To_Interface; |
function "-"
( | Interf | : Gtk.Buildable.Gtk_Buildable) return Gtk_Action renames Implements_Gtk_Buildable.To_Object; |
Actions represent operations that the user can be perform, along with some information 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 <link linkend="GtkToggleAction">toggle actions</link>, which can be toggled between two states and <link linkend="GtkRadioAction">radio actions</link>, of which only one in a group can be in the "active" state. Other actions can be implemented as Gtk.Action.Gtk_Action subclasses.
Each action can have one or more proxy widgets. To act as an action proxy, widget needs to implement Gtk.Activatable.Gtk_Activatable interface.
Proxies mirror the state of the action and should change when the action's state changes. Properties that are always mirrored by proxies are Gtk.Action.Gtk_Action:sensitive and Gtk.Action.Gtk_Action:visible.
Gtk.Action.Gtk_Action:gicon, Gtk.Action.Gtk_Action:icon-name, Gtk.Action.Gtk_Action:label, Gtk.Action.Gtk_Action:short-label and Gtk.Action.Gtk_Action:stock-id properties are only mirorred if proxy widget has Gtk.Activatable.Gtk_Activatable:use-action-appearance property set to True.
When the proxy is activated, it should activate its action.