AccelGroup
Object Hierarchy:
Description:
public class AccelGroup :
Object
A AccelGroup represents a group of keyboard accelerators, typically attached to a
toplevel Window (with add_accel_group
). Usually you won't need to create a AccelGroup directly; instead, when using
GtkItemFactory, GTK+ automatically sets up the accelerators for your menus in the item factory's
AccelGroup.
Note that accelerators are different from mnemonics. Accelerators are shortcuts for activating a menu item; they appear
alongside the menu item they're a shortcut for. For example "Ctrl+Q" might appear alongside the "Quit" menu item. Mnemonics are shortcuts
for GUI elements such as text entries or buttons; they appear as underlined characters. See
Label.with_mnemonic. Menu items can have both accelerators and
mnemonics, of course.
Namespace: Gtk
Package: gtk+-2.0
Content:
Properties:
Static methods:
Creation methods:
Methods:
-
public bool activate (Quark accel_quark, Object acceleratable, uint accel_key, ModifierType accel_mods)
Finds the first accelerator in accel_group that matches accel_key and
accel_mods, and activates it.
-
public void connect (uint accel_key, ModifierType accel_mods, AccelFlags accel_flags, owned AccelGroupActivate closure)
Installs an accelerator in this group. When accel_group is being activated in response to a
call to accel_groups_activate, closure will be invoked if the
accel_key and accel_mods from accel_groups_activate
match those of this connection.
-
public void connect_by_path (string accel_path, owned AccelGroupActivate closure)
Installs an accelerator in this group, using an accelerator path to look up the appropriate key and
modifiers (see add_entry). When accel_group is being
activated in response to a call to accel_groups_activate, closure
will be invoked if the accel_key and accel_mods from
accel_groups_activate match the key and modifiers for the path.
-
public bool disconnect (Closure closure)
Removes an accelerator previously installed through
connect.
-
public bool disconnect_key (uint accel_key, ModifierType accel_mods)
Removes an accelerator previously installed through
connect.
-
public AccelKey* find (AccelGroupFindFunc find_func)
Finds the first entry in an accelerator group for which find_func returns true
and returns its AccelKey.
-
public bool get_is_locked ()
Locks are added and removed using lock and
unlock.
-
public ModifierType get_modifier_mask ()
-
public void lock ()
Locks the given accelerator group.
-
public unowned AccelGroupEntry query (uint accel_key, ModifierType accel_mods, uint n_entries)
Queries an accelerator group for all entries matching accel_key and accel_mods
.
-
public void unlock ()
Undoes the last call to lock on this
accel_group.
Signals:
Fields: