Re: accelerators
- From: Tim Janik <timj gtk org>
- To: Havoc Pennington <hp redhat com>
- Cc: James Henstridge <james daa com au>, Gtk+ Developers <gtk-devel-list gnome org>
- Subject: Re: accelerators
- Date: Sat, 3 Nov 2001 04:57:37 +0100 (CET)
On 1 Nov 2001, Havoc Pennington wrote:
>
> James Henstridge <james daa com au> writes:
> > Is it enough to be able to attach accelerators to signals of objects
> > not derived from GtkWidget? That is already possible with the current
> > API (I made use of it in that menu actions demo I wrote a few months
> > back), so preserving this ability might be sufficient.
>
> I don't think so, the main reason for allowing callbacks is so that
> app authors can easily add an accelerator, without having to
> do a key_press_event handler. Any API that requires deriving a GObject
> is essentially nonexistent for many app authors.
erm, a couple comments for the sake of clarity:
1) key handlers that apply to all widgets of a certain type, e.g. entries
should be done via binding sets
2) adding a key handler to an object does _not_ require derivation,
connecting to ::key_press_event is sufficient.
3) accelerators are gtkwindow global, so can't be viewed as simply
key_press_event handlers on widgets (or you mean deriving GtkWindow
in the above, but then that'd mean extra derivation for each enitity
that adds a shortcut ;-[] )
4) setting up closures as accelerators, takes away two significant burdens
for a shortcut:
- the programmer doesn't need a specific obejct that handles this accel
- the programmer doesn't need the accel be routed through a specific
object's signal (i.e. add multiple RUN_ACTION signals to an object
just to handle couple different accelerators)
>
> Havoc
>
---
ciaoTJ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]