Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gtk::AccelGroup Class Reference

A GtkAccelGroup C++ wrapper class. More...

`#include <inti/gtk/accelgroup.h>`

Inheritance diagram for Inti::Gtk::AccelGroup:

List of all members.

## Public Member Functions

Constructors

- AccelGroup ()
    Construct a new AccelGroup.
- virtual ~AccelGroup ()
    Destructor,.

Accessors

- GtkAccelGroup * gtk_accel_group () const
    Get a pointer to the GtkAccelGroup structure.
- GtkAccelGroupClass * gtk_accel_group_class () const
    Get a pointer to the GtkAccelGroupClass structure.
- operator GtkAccelGroup * () const
    Conversion operator; safely converts an AccelGroup to a GtkAccelGroup pointer.

Methods

- void lock ()
    Locks the given accelerator group.
- void unlock ()
    Undoes the last call to lock() on the accelerator group.
- void connect (const AccelKey &accel_key, GClosure *closure)
    Installs an accelerator in the group.
- void connect (const char *accel_path, GClosure *closure)
    Installs an accelerator in this group, using an accelerator path to look up the appropriate key and modifiers (see Gtk::AccelMap::add_entry()).
- bool disconnect (GClosure *closure)
    Removes an accelerator previously installed through connect().
- bool disconnect (const AccelKey &accel_key)
    Removes an accelerator previously installed through connect().

Signal Proxies

- const AccelChangedSignalProxy sig_accel_changed ()
    Connect to the accel_changed_signal; emitted when an accelerator is changed.

## Static Public Member Functions

- AccelGroup * from_accel_closure (GClosure *closure)
    Finds the AccelGroup to which closure is connected; (see connect()).

## Protected Member Functions

Constructors

- AccelGroup (GtkAccelGroup *group, bool reference=true)
    Construct a new AccelGroup from an existing GtkAccelGroup.

Signal Handlers

- virtual void on_accel_changed (const AccelKey &accel_key, GClosure *accel_closure)
    Called when an accelerator key is changed.

## Detailed Description

A GtkAccelGroup C++ wrapper class.

AccelGroup represents a group of keyboard accelerators, typically attached to a toplevel Gtk::Window (with Gtk::Window::add_accel_group()). Usually you won't need to create an AccelGroup directly; instead, when using Gtk::ItemFactory and Gtk::Menu, GTK+ automatically sets up the accelerators for your menus in the default accelerator group.

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. Menu items can have both accelerators and mnemonics, of course.

## Constructor & Destructor Documentation

Inti::Gtk::AccelGroup::AccelGroup | ( | GtkAccelGroup * | group,
|  | bool | reference = true
| ) | `[explicit, protected]`

Construct a new AccelGroup from an existing GtkAccelGroup.

Parameters:

  group | A pointer to a GtkAccelGroup.
  reference | Set false if the initial reference count is floating, set true if it's not.

The group can be a newly created GtkAccelGroup or an existing GtkAccelGroup. (see G::Object::Object).

## Member Function Documentation

void Inti::Gtk::AccelGroup::connect | ( | const char * | accel_path,
|  | GClosure * | closure
| ) |

Installs an accelerator in this group, using an accelerator path to look up the appropriate key and modifiers (see Gtk::AccelMap::add_entry()).

Parameters:

  accel_path | The path used for determining the accelerator key value and modifiers.
  closure | Closure to be executed upon accelerator activation.

When the accelerator group is being activated in response to a call to activate(), closure will be invoked if the accelerator key value and modifiers from activate() match the key and modifiers for the path.

void Inti::Gtk::AccelGroup::connect | ( | const AccelKey & | accel_key,
|  | GClosure * | closure
| ) |

Installs an accelerator in the group.

Parameters:

  accel_key | An AccelKey specifying the accelerator key value, modifiers and flags.
  closure | Closure to be executed upon accelerator activation.

When the accelerator group is being activated in response to a call to activate(), closure will be invoked if the accelerator key value and modifiers from activate() match those of this connection.

Note that, due to implementation details, a single closure can only be connected to one accelerator group.

bool Inti::Gtk::AccelGroup::disconnect | ( | const AccelKey & | accel_key | ) |

Removes an accelerator previously installed through connect().

Parameters:

  accel_key | An AccelKey specifying the accelerator key value and modifiers.

Returns:
  true if there was an accelerator which could be removed, fakse otherwise.

bool Inti::Gtk::AccelGroup::disconnect | ( | GClosure * | closure | ) |

Removes an accelerator previously installed through connect().

Parameters:

  closure | The closure to remove from this accelerator group.

Returns:
  true if the closure was found and got disconnected.

AccelGroup* Inti::Gtk::AccelGroup::from_accel_closure | ( | GClosure * | closure | ) | `[static]`

Finds the AccelGroup to which closure is connected; (see connect()).

Parameters:

  closure | A closure.

Returns:
  The AccelGroup to which closure is connected, or null.

void Inti::Gtk::AccelGroup::lock | ( |  | ) |

| Locks the given accelerator group. Locking an accelerator group prevents the accelerators contained within it being changed during runtime. Refer to Gtk::AccelMap::change_entry() about runtime accelerator changes. If called more than once, the accelerator group remains locked until unlock() has been called an equivalent number of times.

virtual void Inti::Gtk::AccelGroup::on_accel_changed | ( | const AccelKey & | accel_key,
|  | GClosure * | accel_closure
| ) | `[protected, virtual]`

Called when an accelerator key is changed.

Parameters:

  accel_key | An AccelKey specifying the accelerator key value and modifiers.
  accel_closure | Closure to be executed upon accelerator activation.

The documentation for this class was generated from the following file:

- accelgroup.h

Main Page - Footer