Toc Gallery Index Tree Gtk.Accel_Group

Hierarchy

Description

An accel group represents a group of keyboard accelerators, generally attached to a toplevel window. Accelerators are different from mnemonics. Accelerators are shortcuts for activating a menu item. They appear alongside the menu item they are a shortcut for. Mnemonics are shortcuts for GUI elements, such as buttons. They appear as underline characters. Menu items can have both.

Types

  • type Gtk_Accel_Flags is new Guint;
  • type Gtk_Accel_Group is access all Gtk_Accel_Group_Record'Class;
  • type Gtk_Accel_Group_Activate is access function (Accel_Group : access Gtk_Accel_Group_Record'Class; Acceleratable : Glib.Object.GObject; Keyval : Gdk.Types.Gdk_Key_Type; Modifier : Gdk.Types.Gdk_Modifier_Type) return Boolean;
  • type Gtk_Accel_Group_Entry is new Gdk.C_Proxy;
  • type Gtk_Accel_Group_Record is new Glib.Object.GObject_Record with private;
  • type Gtk_Accel_Key is record Accel_Key : Gdk.Types.Gdk_Key_Type;

Subprograms

  • procedure Gtk_New (Accel_Group : out Gtk_Accel_Group);
    procedure Initialize (Accel_Group : access Gtk_Accel_Group_Record'Class);
    Remember to call Gtk.Window.Add_Accel_Group to active the group.
  • function Get_Type return Glib.GType;
    Return the internal value associated with a Gtk_Accel_Group.
  • procedure Lock (Accel_Group : access Gtk_Accel_Group_Record);
    procedure Unlock (Accel_Group : access Gtk_Accel_Group_Record);
    Locks or unlocks the group. When a group is locked, the accelerators contained in it cannot be changed at runtime by the user. See Gtk_Accel_Map.Change_Entry about runtime accelerator changes. Unlock must be called the same number of time that Lock was called.
  • Groups

  • function Accel_Groups_Activate (Object : access Gtk.Object.Gtk_Object_Record'Class; Accel_Key : Gdk.Types.Gdk_Key_Type; Accel_Mods : Gdk.Types.Gdk_Modifier_Type) return Boolean;
    Find the first accelerator in any group, attached to Object that matches the given key and modifier, and activate that accelerator. Returns True if an accelerator was activated.
  • function From_Object (Object : access Gtk.Object.Gtk_Object_Record'Class) return Object_List.GSlist;
    Gets a list of all accel groups which are attached to Object.
  • Accelerators

  • function Accelerator_Valid (Keyval : Gdk.Types.Gdk_Key_Type; Modifiers : Gdk.Types.Gdk_Modifier_Type) return Boolean;
    Determines whether a given keyval and modifier constitute a valid accelerator. For instance, GDK_Control_L is not a valid accelerator, whereas Gdk_L associated with Control_Mask is valid.
  • procedure Accelerator_Parse (Accelerator : String; Accelerator_Key : out Gdk.Types.Gdk_Key_Type; Accelerator_Mods : out Gdk.Types.Gdk_Modifier_Type);
    Parse a string representing an accelerator. The format looks like "a", "a" or "z" (the last one applies to a key release. Abbreviations such as "Ctrl" are allowed.
  • function Accelerator_Name (Accelerator_Key : Gdk.Types.Gdk_Key_Type; Accelerator_Mods : Gdk.Types.Gdk_Modifier_Type) return String;
    Converts an accelerator keyval and modifier mask into a string parseable by Accelerator_Parse. For example, if you pass in GDK_q and GDK_CONTROL_MASK, this function returns "q". If you need to display accelerators in the user interface, see Accelerator_Get_Label.
  • function Accelerator_Get_Label (Accelerator_Key : Gdk.Types.Gdk_Key_Type; Accelerator_Mods : Gdk.Types.Gdk_Modifier_Type) return String;
    Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user.
  • procedure Set_Default_Mod_Mask (Default_Mod_Mask : Gdk.Types.Gdk_Modifier_Type);
    function Get_Default_Mod_Mask return Gdk.Types.Gdk_Modifier_Type;
    Sets the modifiers that will be considered significant for keyboard accelerators. The default mod mask is GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK, that is, Control, Shift, and Alt. Other modifiers will by default be ignored by GtkAccelGroup. You must include at least the three default modifiers in any value you pass to this function.

    The default mod mask should be changed on application startup, before using any accelerator groups.

Signals

  • accel_activate
    procedure Handler (Group : access Gtk_Accel_Group_Record'Class; Acceleratable : access GObject_Record'Class; Keyval : Gdk_Key_Type; Modifier : Gdk_Modifier_Type);
    This is an implementation detail, not meant to be used by applications
  • accel_changed
    procedure Handler (Group : access Gtk_Accel_Group_Record'Class; Keyval : Gdk_Key_Type; Modifier : Gdk_Modifier_Type; Closure : GClosure);
    Emitted when a Gtk_Accel_Group_Entry is added to or removed from the accel group. Widgets like Gtk_Accel_Label which display an associated accelerator should connect to this signal, and rebuild their visual representation if the accel_closure is theirs.

Alphabetical Index