Re: Trouble setting GdkEventMask



Ron Steinke <rsteinke w-link net> writes: 
> That was it. Thanks. Perhaps a short lecture on the way focus works
> in GTK is in order?
> 

Well, it isn't really that complicated from this standpoint - 
if you want your widget to get focus you set GTK_CAN_FOCUS, then
whenever you get the focus (normally from tab key or a mnemonic, or
widgets can implement button_press handlers), then you will get key
events.

The more complicated issues are:
 - how GTK decides on the tab order (GtkWidget::focus method)
 - the overall key event handling (Owen has a diagram somewhere)

Basically, key events go first to the focus widget, if not used there
they go to the toplevel window. 

If you want "global" hotkeys, then you want to connect to
key_press_event on the toplevel, rather than on a child widget.

Havoc




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