Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::Gtk::AccelGroup Class Reference

GtkAccelGroup C++ wrapper class. More...

#include <xfc/gtk/accelgroup.hh>

Inheritance diagram for Xfc::Gtk::AccelGroup:

Xfc::G::Object Xfc::G::TypeInstance Xfc::Trackable List of all members.

Signal Prototypes

Public Member Functions

Accessors
Methods
Signal Proxies

Static Public Member Functions

Accessors

Detailed Description

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.

Note: dynamically allocated objects must either be unreferenced or assigned to a smart pointer. Stack objects are automatically unreferenced when they go out of scope.


Constructor & Destructor Documentation

Xfc::Gtk::AccelGroup::AccelGroup ( GtkAccelGroup *  group,
bool  owns_reference = true 
) [explicit, protected]

Construct a new AccelGroup from an existing GtkAccelGroup.

Parameters:
group A pointer to a GtkAccelGroup.
owns_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).

Xfc::Gtk::AccelGroup::AccelGroup ( GtkAccelGroup *  group,
bool  owns_reference = true 
) [explicit, protected]

Construct a new AccelGroup from an existing GtkAccelGroup.

Parameters:
group A pointer to a GtkAccelGroup.
owns_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

static AccelGroup* Xfc::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 Xfc::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.

void Xfc::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.

void Xfc::Gtk::AccelGroup::connect ( const String 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.

bool Xfc::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.

bool Xfc::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.


Member Data Documentation

const AccelChangedSignalType Xfc::Gtk::AccelGroup::accel_changed_signal [static, protected]

Accelerator changed signal (see signal_accel_changed()).

Calls a slot with the signature:

< void function(const AccelKey& accel_key, GClosure *accel_closure);
< // 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: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3