Index

Package: Accel_Group

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.

Binding from C File version 2.16

Classes

Gtk_Accel_Group_Record

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

Ancestors:

Primitive operations:

Get_Is_Locked
Get_Modifier_Mask
Glib.Object.Deallocate (Inherited)
Glib.Object.Get_Type (Inherited)
Glib.Object.Notify (Inherited)
Glib.Object.Ref (Inherited)
Glib.Object.Unref (Inherited)

Types

Gtk_Accel_Group

type Gtk_Accel_Group is access all Gtk_Accel_Group_Record'Class;

Gtk_Accel_Group_Entry

type Gtk_Accel_Group_Entry is new Gdk.C_Proxy;

Gtk_Accel_Flags

type Gtk_Accel_Flags is new Guint;

Gtk_Accel_Key

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

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;

Constants & Global variables

Accel_Visible (Gtk_Accel_Flags)

Accel_Visible : constant Gtk_Accel_Flags;

Accel_Locked (Gtk_Accel_Flags)

Accel_Locked  : constant Gtk_Accel_Flags;

Accel_Mask (Gtk_Accel_Flags)

Accel_Mask    : constant Gtk_Accel_Flags;

Signal_Accel_Activate (Glib.Signal_Name)

Signal_Accel_Activate : constant Glib.Signal_Name := "accel_activate";

Signal_Accel_Changed (Glib.Signal_Name)

Signal_Accel_Changed  : constant Glib.Signal_Name := "accel_changed";

Subprograms & Entries

Gtk_New

procedure Gtk_New 
(Accel_Group: out Gtk_Accel_Group);

Initialize

procedure Initialize 
(Accel_Group: access Gtk_Accel_Group_Record'Class);
Remember to call Gtk.Window.Add_Accel_Group to active the group.

Get_Type

function Get_Type return Glib.GType;
Return the internal value associated with a Gtk_Accel_Group.

Lock

procedure Lock 
(Accel_Group: access Gtk_Accel_Group_Record);

Unlock

procedure Unlock 
(Accel_Group: access Gtk_Accel_Group_Record);

Get_Is_Locked

function Get_Is_Locked 
(Accel_Group: access Gtk_Accel_Group_Record) return Boolean;
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.

Accel_Groups_Activate

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.

From_Object

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.

Accelerator_Valid

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.

Accelerator_Parse

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 "<Control>a", "<Shift><Alt>a" or "<Release>z" (the last one applies to a key release. Abbreviations such as "Ctrl" are allowed.

Accelerator_Name

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 "<Control>q". If you need to display accelerators in the user interface, see Accelerator_Get_Label.

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.

Set_Default_Mod_Mask

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

Get_Default_Mod_Mask

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.

Get_Modifier_Mask

function Get_Modifier_Mask 
(Accel_Group: access Gtk_Accel_Group_Record) return Gdk.Types.Gdk_Modifier_Type;
Gets a modifier type representing the mask for this Accel_Group. For example, GDK_CONTROL_MASK, GDK_SHIFT_MASK, etc.