Re: Need advice on key_press_event.

Tim Janik <> writes:

> > Well, there are a couple of ways of doing it. You can use
> > the accelerator mechanism. This basically does a binding
> > of 
> > 
> >  key press on top level window => signal emission
> > 
> > You presumably already have an accelerator group if you
> > have a menu where key bindings work, so you'd just
> > need to call gtk_accel_group_add().
> owen, you should really know better. most of the gtk_accel_group_*
> API is internal stuff, and gtk_accel_group_add() is no exception to
> this. what he really wants to use is gtk_widget_add_accelerator().

OK, bud, where's the RDP documentation on using accelerators?


To further defend myself by going on the offensive, I'll say that the
gtkaccelgroup design is just a bit odd. The accelgroup should just be
a map from accelerator key to (widget, signal) pair.

The fact that it is closely bound up into gtkwidget.c with
::add_accelerator, ::remove_accelerator signals, etc., is all dictated
by the change-accelerators-on-the-fly feature, that most people don't
know/care about anyways.

AcceleratorTable, AccelGroup, ... anybody for AccSet ?

Hmmm, Tim is going to be angry at me now...


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]