Toc Gallery Index Tree Gtk.Action

Hierarchy

Description

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.

Types

Subprograms

  • procedure Gtk_New (Action : out Gtk_Action; Name : String; Label : String; Tooltip : String := ""; Stock_Id : String := "");
    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.
  • 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.
  • function Get_Type return GType;
    Return the internal value associated with a Gtk_Action
  • 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.
  • procedure Connect_Accelerator (Action : access Gtk_Action_Record);
    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.
  • 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.
  • 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.
  • 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.
  • 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.
  • procedure Set_Accel_Path (Action : access Gtk_Action_Record; Accel_Path : String);
    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.
  • function Get_Name (Action : access Gtk_Action_Record) return String;
    Returns the name of the action.
  • procedure Set_Sensitive (Action : access Gtk_Action_Record; Sensitive : Boolean);
    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.
  • 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.
  • procedure Set_Visible (Action : access Gtk_Action_Record; Visible : Boolean);
    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.
  • 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.
  • Proxies

  • procedure Connect_Proxy (Action : access Gtk_Action_Record; Proxy : access Gtk.Widget.Gtk_Widget_Record'Class);
    procedure Disconnect_Proxy (Action : access Gtk_Action_Record; Proxy : access Gtk.Widget.Gtk_Widget_Record'Class);
    Connects a widget to an action object as a proxy. Synchronises various properties of the action with the widget (such as label text, icon, tooltip, etc), and attaches a callback so that the action gets activated when the proxy widget does. If the widget is already connected to an action, it is disconnected first. Disconnect_Proxy does not destroy the widget.
  • 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
  • procedure Block_Activate_From (Action : access Gtk_Action_Record; Proxy : access Gtk.Widget.Gtk_Widget_Record'Class);
    procedure Unblock_Activate_From (Action : access Gtk_Action_Record; Proxy : access Gtk.Widget.Gtk_Widget_Record'Class);
    Disables calls to the Activate function by signals on the given proxy widget. This is used to break notification loops for things like check or radio actions. This function is intended for use by action implementations.

Signals

  • activate
    procedure Handler (Action : access Gtk_Action_Record'Class);
    The "activate" signal is emitted when the action is activated.

Properties

  • Action_Group_Property
    Object
    The Gtk_Action_Group this Gtk_Action is associated with, or NULL
  • Hide_If_Empty_Property
    Boolean
    When TRUE, empty menu proxies for this action are hidden.
  • Is_Important_Property
    Boolean
    Whether the action is considered important.
  • Label_Property
    String
    The label used for menu items and buttons
  • Name_Property
    String
    A unique name for the action.
  • Sensitive_Property
    Boolean
    Whether the action is enabled.
  • Short_Label_Property
    String
    A shorter label that may be used on toolbar buttons.
  • Stock_Id_Property
    String
    The stock icon displayed in widgets representing
  • Tooltip_Property
    String
    A tooltip for this action.
  • Visible_Horizontal_Property
    Boolean
    Whether the toolbar item is visible when the toolbar
  • Visible_Overflown_Property
    Boolean
    When TRUE, toolitem proxies for this action
  • Visible_Property
    Boolean
    Whether the action is visible.
  • Visible_Vertical_Property
    Boolean
    Whether the toolbar item is visible when the toolbar

Alphabetical Index