## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

## Index

Package: Accel_Group

- Goto spec source

# Description

    package Gtk.Accel_Group is

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.

# Classes

### Gtk_Accel_Group_Record

- Goto declaration in source

    type Gtk_Accel_Group_Record is new GObject_Record with null record;

#### Ancestors:

Glib.Object.GObject_Record

#### Primitive operations:

Activate

- To API doc
- To spec

Connect

- To API doc
- To spec

Connect_By_Path

- To API doc
- To spec

Disconnect

- To API doc
- To spec

Disconnect_Key

- To API doc
- To spec

Find

- To API doc
- To spec

Get_Is_Locked

- To API doc
- To spec

Get_Modifier_Mask

- 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)
Lock

- To API doc
- To spec

Unlock

- To API doc
- To spec

# Types

### Gtk_Accel_Group

- Goto declaration in source

    type Gtk_Accel_Group is access all Gtk_Accel_Group_Record'Class;

### Gtk_Accel_Flags

- Goto declaration in source

    type Gtk_Accel_Flags is new Guint;

### Gtk_Accel_Key

- Goto declaration in source

    type Gtk_Accel_Key is record
          Accel_Key  : Gdk.Types.Gdk_Key_Type;
          Accel_Mods : Gdk.Types.Gdk_Modifier_Type;
          Flags      : Gtk_Accel_Flags;
       end record;

### Gtk_Accel_Group_Activate

- Goto declaration in source

    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;

### C_Gtk_Accel_Group_Activate

- Goto declaration in source

    type C_Gtk_Accel_Group_Activate is access function
         (Accel_Group   : System.Address;
          Acceleratable : System.Address;
          Keyval        : Gdk.Types.Gdk_Key_Type;
          Modifier      : Gdk.Types.Gdk_Modifier_Type) return Boolean;

### C_Gtk_Accel_Group_Find_Func

- Goto declaration in source

    type C_Gtk_Accel_Group_Find_Func is access function
         (Key           : access Gtk_Accel_Key;
          Closure       : C_Gtk_Accel_Group_Activate;
          Data          : System.Address) return Boolean;

# Constants & Global variables

### Accel_Visible

- Goto declaration in source

(Gtk_Accel_Flags)

    Accel_Visible : constant Gtk_Accel_Flags := 2 ** 0;

### Accel_Locked

- Goto declaration in source

(Gtk_Accel_Flags)

    Accel_Locked  : constant Gtk_Accel_Flags := 2 ** 1;

### Accel_Mask

- Goto declaration in source

(Gtk_Accel_Flags)

    Accel_Mask    : constant Gtk_Accel_Flags := 16#07#;

### Is_Locked_Property

- Goto declaration in source

(Glib.Properties.Property_Boolean)

    Is_Locked_Property : constant Glib.Properties.Property_Boolean;

### Modifier_Mask_Property

- Goto declaration in source

(Glib.Properties.Property_Boxed)

    Modifier_Mask_Property : constant Glib.Properties.Property_Boxed;

### Signal_Accel_Activate

- Goto declaration in source

(Glib.Signal_Name)

    Signal_Accel_Activate : constant Glib.Signal_Name := "accel-activate";

### Signal_Accel_Changed

- Goto declaration in source

(Glib.Signal_Name)

    Signal_Accel_Changed : constant Glib.Signal_Name := "accel-changed";

# Subprograms & Entries

### Gtk_New

- Goto spec in source

    procedure Gtk_New (Accel_Group: out Gtk_Accel_Group);

### Initialize

- Goto spec in source

    procedure Initialize (Accel_Group: access Gtk_Accel_Group_Record'Class);

Creates a new Gtk.Accel_Group.Gtk_Accel_Group. Remember to call Gtk.Window.Add_Accel_Group to active the group.

### Get_Type

- Goto spec in source
- Goto body in source

    function Get_Type return Glib.GType;

### Activate

- Goto spec in source

    function Activate (Accel_Group: access Gtk_Accel_Group_Record;Accel_Quark: GQuark;Acceleratable: access Glib.Object.GObject_Record'Class;Accel_Key: Guint;Accel_Mods: Gdk.Types.Gdk_Modifier_Type) return Boolean;

Finds the first accelerator in Accel_Group that matches Accel_Key and Accel_Mods, and activates it. "accel_quark": the quark for the accelerator name "acceleratable": the GObject, usually a Gtk.Window.Gtk_Window, on which to activate the accelerator. "accel_key": accelerator keyval from a key event "accel_mods": keyboard state mask from a key event

### Connect

- Goto spec in source

    procedure Connect (Accel_Group: access Gtk_Accel_Group_Record;Accel_Key: Guint;Accel_Mods: Gdk.Types.Gdk_Modifier_Type;Accel_Flags: Gtk_Accel_Flags;Closure: C_Gtk_Accel_Group_Activate);

Installs an accelerator in this group. When Accel_Group is being activated in response to a call to Gtk.Accel_Group.Accel_Groups_Activate, Closure will be invoked if the Accel_Key and Accel_Mods from Gtk.Accel_Group.Accel_Groups_Activate match those of this connection. The signature used for the Closure is that of GtkAccelGroupActivate. Note that, due to implementation details, a single closure can only be connected to one accelerator group. "accel_key": key value of the accelerator "accel_mods": modifier combination of the accelerator "accel_flags": a flag mask to configure this accelerator "closure": closure to be executed upon accelerator activation

### Connect_By_Path

- Goto spec in source

    procedure Connect_By_Path (Accel_Group: access Gtk_Accel_Group_Record;Accel_Path: UTF8_String;Closure: C_Gtk_Accel_Group_Activate);

Installs an accelerator in this group, using an accelerator path to look up the appropriate key and modifiers (see Gtk.Accel_Map.Add_Entry). When Accel_Group is being activated in response to a call to Gtk.Accel_Group.Accel_Groups_Activate, Closure will be invoked if the Accel_Key and for the path. The signature used for the Closure is that of GtkAccelGroupActivate. Note that Accel_Path string will be stored in a GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with g_intern_static_string. "accel_path": path used for determining key and modifiers. "closure": closure to be executed upon accelerator activation

### Disconnect

- Goto spec in source

    function Disconnect (Accel_Group: access Gtk_Accel_Group_Record;Closure: C_Gtk_Accel_Group_Activate) return Boolean;

Removes an accelerator previously installed through Gtk.Accel_Group.Connect. Since 2.20 Closure can be null. "closure": the closure to remove from this accelerator group, or null to remove all closures

### Disconnect_Key

- Goto spec in source

    function Disconnect_Key (Accel_Group: access Gtk_Accel_Group_Record;Accel_Key: Guint;Accel_Mods: Gdk.Types.Gdk_Modifier_Type) return Boolean;

Removes an accelerator previously installed through Gtk.Accel_Group.Connect. "accel_key": key value of the accelerator "accel_mods": modifier combination of the accelerator

### Find

- Goto spec in source

    function Find (Accel_Group: access Gtk_Accel_Group_Record;Find_Func: C_Gtk_Accel_Group_Find_Func;Data: System.Address) return Gtk_Accel_Key;

Finds the first entry in an accelerator group for which "find_func": a function to filter the entries of Accel_Group with "data": data to pass to Find_Func

### Get_Is_Locked

- Goto spec in source

    function Get_Is_Locked (Accel_Group: access Gtk_Accel_Group_Record) return Boolean;

Locks are added and removed using Gtk.Accel_Group.Lock and Gtk.Accel_Group.Unlock. False otherwise. Since: gtk+ 2.14

### Get_Modifier_Mask

- Goto spec in source

    function Get_Modifier_Mask (Accel_Group: access Gtk_Accel_Group_Record) return Gdk.Types.Gdk_Modifier_Type;

Gets a Gdk.Types.Gdk_Modifier_Type representing the mask for this Since: gtk+ 2.14

### Lock

- Goto spec in source

    procedure Lock (Accel_Group: access Gtk_Accel_Group_Record);

Locks the given accelerator group. Locking an acelerator group prevents the accelerators contained within it to be changed during runtime. Refer to Gtk.Accel_Map.Change_Entry about runtime accelerator changes. If called more than once, Accel_Group remains locked until Gtk.Accel_Group.Unlock has been called an equivalent number of times.

### Unlock

- Goto spec in source

    procedure Unlock (Accel_Group: access Gtk_Accel_Group_Record);

Undoes the last call to Gtk.Accel_Group.Lock on this Accel_Group.

### From_Accel_Closure

- Goto spec in source

    function From_Accel_Closure (Closure: C_Gtk_Accel_Group_Activate) return Gtk.Accel_Group.Gtk_Accel_Group;

Finds the Gtk.Accel_Group.Gtk_Accel_Group to which Closure is connected; see Gtk.Accel_Group.Connect. "closure": a GClosure

### Accel_Groups_Activate

- Goto spec in source

    function Accel_Groups_Activate (Object: access Glib.Object.GObject_Record'Class;Accel_Key: Gdk.Types.Gdk_Key_Type;Accel_Mods: Gdk.Types.Gdk_Modifier_Type) return Boolean;

Finds the first accelerator in any Gtk.Accel_Group.Gtk_Accel_Group attached to Object that matches Accel_Key and Accel_Mods, and activates that accelerator. "object": the GObject, usually a Gtk.Window.Gtk_Window, on which to activate the accelerator. "accel_key": accelerator keyval from a key event "accel_mods": keyboard state mask from a key event

### From_Object

- Goto spec in source

    function From_Object (Object: access Glib.Object.GObject_Record'Class) return Glib.Object.Object_List.GSList;

Gets a list of all accel groups which are attached to Object. "object": a GObject, usually a Gtk.Window.Gtk_Window

### Accelerator_Valid

- Goto spec in source

    function Accelerator_Valid (Keyval: Gdk.Types.Gdk_Key_Type;Modifiers: Gdk.Types.Gdk_Modifier_Type) return Boolean;

Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator. For example, the GDK_a keyval plus GDK_CONTROL_MASK is valid - this is a "Ctrl+a" accelerator. But, you can't, for instance, use the GDK_Control_L keyval as an accelerator. "keyval": a GDK keyval "modifiers": modifier mask

### Accelerator_Parse

- Goto spec in source

    procedure Accelerator_Parse (Accelerator: UTF8_String;Accelerator_Key: out Gdk.Types.Gdk_Key_Type;Accelerator_Mods: out Gdk.Types.Gdk_Modifier_Type);

Parses a string representing an accelerator. The format looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or "&lt;Release&gt;z" (the last one is for key release). The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;". Key names are parsed using gdk_keyval_from_name. For character keys the name is not the symbol, but the lowercase name, e.g. one would use "&lt;Ctrl&gt;minus" instead of "&lt;Ctrl&gt;-". If the parse fails, Accelerator_Key and Accelerator_Mods will be set to 0 (zero). "accelerator": string representing an accelerator "accelerator_key": return location for accelerator keyval "accelerator_mods": return location for accelerator modifier mask

### Accelerator_Name

- Goto spec in source

    function Accelerator_Name (Accelerator_Key: Gdk.Types.Gdk_Key_Type;Accelerator_Mods: Gdk.Types.Gdk_Modifier_Type) return UTF8_String;

Converts an accelerator keyval and modifier mask into a string parseable by Gtk.Accel_Group.Accelerator_Parse. For example, if you pass in GDK_q and GDK_CONTROL_MASK, this function returns "&lt;Control&gt;q". If you need to display accelerators in the user interface, see Gtk.Accel_Group.Accelerator_Get_Label. "accelerator_key": accelerator keyval "accelerator_mods": accelerator modifier mask

### Accelerator_Get_Label

- Goto spec in source

    function Accelerator_Get_Label (Accelerator_Key: Gdk.Types.Gdk_Key_Type;Accelerator_Mods: Gdk.Types.Gdk_Modifier_Type) return UTF8_String;

Converts an accelerator keyval and modifier mask into a string which can be used to represent the accelerator to the user. Since: gtk+ 2.6 "accelerator_key": accelerator keyval "accelerator_mods": accelerator modifier mask

### Set_Default_Mod_Mask

- Goto spec in source

    procedure Set_Default_Mod_Mask (Default_Mod_Mask: Gdk.Types.Gdk_Modifier_Type);

### Get_Default_Mod_Mask

- Goto spec in source

    function Get_Default_Mod_Mask return Gdk.Types.Gdk_Modifier_Type;

Gets the value set by Gtk.Accel_Group.Set_Default_Mod_Mask.