## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

## Index

Package: Accel_Map

- Goto spec source

# Description

    package Gtk.Accel_Map is

An accel_map provides support for loading and saving accelerators (see also Gtk.Accel_Group).

Binding from C File version 2.8.17

# Classes

### Gtk_Accel_Map_Record

- Goto declaration in source

    type Gtk_Accel_Map_Record is
         new Glib.Object.GObject_Record with null record;

#### Ancestors:

Glib.Object.GObject_Record

#### Primitive operations:

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)

# Types

### Gtk_Accel_Map

- Goto declaration in source

    type Gtk_Accel_Map is access all Gtk_Accel_Map_Record'Class;

### Gtk_Accel_Map_Foreach

- Goto declaration in source

    type Gtk_Accel_Map_Foreach is access procedure
         (Data       : System.Address;
          Accel_Path : String;
          Accel_Key  : Gdk.Types.Gdk_Key_Type;
          Accel_Mods : Gdk.Types.Gdk_Modifier_Type;
          Changed    : Boolean);

Changed is set to true if the keybinding was changed manually by the user, and thus would need saving during an accelerator map dump.

# Constants & Global variables

### Signal_Changed

- Goto declaration in source

(Glib.Signal_Name)

    Signal_Changed : constant Glib.Signal_Name := "changed";

# Subprograms & Entries

### Get

- Goto spec in source

    function Get return Gtk_Accel_Map;

Gets the singleton global Gtk_Accel_Map object. This object is useful only for notification of changes to the accelerator map via the ::changed signal; it isn't a parameter to the other accelerator map functions.

### Get_Type

- Goto spec in source
- Goto body in source

    function Get_Type return Glib.GType;

Return the internal type used for a Gtk_Accel_Map

### Save

- Goto spec in source

    procedure Save (File_Name: String);

Save the key shortcuts to a file. These are the shortcuts that might have been changed dynamically by the user, if the RC file (see Gtk.RC) contained the line "gtk-can-change-accels=1"

### Load

- Goto spec in source

    procedure Load (File_Name: String);

Load the key shortcuts from a file

### Add_Entry

- Goto spec in source

    procedure Add_Entry (Accel_Path: String;Accel_Key: Gdk.Types.Gdk_Key_Type;Accel_Mods: Gdk.Types.Gdk_Modifier_Type);

Register a new accelerator for a given menu item, within the global accelerator map. This function should only be called once per Accel_Path. To change it programmatically during runtime, use Change_Entry. Accel_Path is of the form: <app>/Category1/Category2/.../Action", where "app" is a unique, application-specific identifier (for examples of valid Accel_Path, check the file created by Save above). For instance, the path in the testgtk application for the menu File->Open would be <testgtk>/file/open Generally, the path need to be set explicitely for an item, through a call to Gtk.Menu_Item.Set_Accel_Path or Gtk.Widget.Set_Accel_Path. However, if the widget is created automatically through a Gtk.Item_Factory, this is done automatically. It is better to use this function instead of Add_Accelerator, since when the accelerators are changed interactively by the user, the new value will be shown properly in the menu, which wouldn't happen if they had been forced by Add_Accelerator.

### Lookup_Entry

- Goto spec in source

    procedure Lookup_Entry (Accel_Path: String;Key: out Gtk.Accel_Group.Gtk_Accel_Key;Found: out Boolean);

Look up the accelerator for Accel_Path, and set Key appropriately. If no accelerator was set, Found is set to False, and the value of Key is meaningless.

### Change_Entry

- Goto spec in source

    function Change_Entry (Accel_Path: String;Accel_Key: Gdk.Types.Gdk_Key_Type;Accel_Mods: Gdk.Types.Gdk_Modifier_Type;Replace: Boolean) return Boolean;

Change the accelerator currently associated wtih Accel_Path. A change may not always be possible due to conflicts with other accelerators. Replace should be set to True if other accelerators may be deleted to resolve such conflicts. Returns True if the entry could be changed

### Lock_Path

- Goto spec in source

    procedure Lock_Path   (Accel_Path: String);

### Unlock_Path

- Goto spec in source

    procedure Unlock_Path (Accel_Path: String);

Locks the given accelerator path. If the accelerator map doesn't yet contain an entry for Accel_Path, a new one is created. Locking an accelerator path prevents its accelerator from being changed during runtime. A locked accelerator path can be unlocked by Unlock_Path. Refer to Change_Entry for information about runtime accelerator changes. If called more than once, Accel_Path remains locked until Unlock_Path has been called an equivalent number of times. Note that locking of individual accelerator paths is independent from locking the Gtk_Accel_Group containing them. For runtime accelerator changes to be possible both the accelerator path and its accel group have to be unlocked.

### Add_Filter

- Goto spec in source

    procedure Add_Filter (Filter_Pattern: String);

Adds a filter to the global list of accel path filters. Accel map entries whose accel path matches one of the filters are skipped by Foreach. This function is intended for GTK+ modules that create their own menus, but don't want them to be saved into the applications accelerator map dump.

### Foreach

- Goto spec in source

    procedure Foreach (Data: System.Address;Func: Gtk_Accel_Map_Foreach);

Calls Func for each of the currently defined key shortcuts. Data is passed as is to Func

### Foreach_Unfiltered

- Goto spec in source

    procedure Foreach_Unfiltered (Data: System.Address;Func: Gtk_Accel_Map_Foreach);

Loops over all entries in the accelerator map, and execute Func on each.