RE: [gtk-list] [Q]: EventBox and key_press_event



Hi,

I had an equal kind of problem: I had to let a drawingarea catch key events when a window had focus. I use gtk_widget_grab_focus (widget) after the widget is shown to let that widget get the events (there are also scrollbars in my window which work fine!).

Hope this will do the job.

regards,

Arjan

> -----Original Message-----
> From: Preben Randhol [mailto:randhol@pvv.org]
> Sent: Friday, August 20, 1999 10:28 AM
> To: gtk-list@redhat.com
> Subject: [gtk-list] [Q]: EventBox and key_press_event
> 
> 
> 
> How do one get the EventBox to register key_press_events?
> 
> I tried the EventBox example in the GTK+ tutorial, and it 
> worked. There
> the Eventbox registers button_press_event. I changed the code so that
> the it should register key_press_event instead of button_press_event,
> but this doesn't work. The callback is not called when I press a key.
> 
> Is it possible to get this to work? How? The reason I'm asking is that
> I have a widget that needs to registers keys like PG_down and Up so
> that I can get it to scroll.
> 
> Any help much appreciated.



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