Re: [gtk-list] Re: Problem: no key press/release events.




On Mon, 16 Aug 1999, Tomi Ollila wrote:
> 
> OK. I read the sample manual at: http://pobox.com/~hp/gnome-app-devel.html
> and noticed the problem is w/ `keyboard' focus. If I understood right, 
> W/ G[DT]K only toplevel window receives keyboard events and it redirects
> the data to the widget in question.
> 
> I reorganized by code a bit to test this, and indeed -- when I add the
> keypress/release masks to the toplevel window and connect the signals
> accorginfly, I get the events... 
> 
> Now one thing I yet not know: How to add my eventbox widget to the list
> of widgets where the toplevel window enters focus?
> 

You just have to gtk_widget_add_events() to add KEY_PRESS_MASK to your 
event box, then set the GTK_CAN_FOCUS flag:

 GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS)

HTH,
Havoc




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