Re: Can A Drawable Canvas Receive Key Events?



On Fri, 2007-03-30 at 13:02 -0700, Mike Melanson wrote:
Hi,

I have a standalone test app that has nothing inside the main window but 
a big, drawable RGB canvas (GtkDrawingArea). I can receive nearly any 
kind of event via the canvas: Expose, mouse motion, button 
press/release, scroll wheel, etc. However, I *cannot* figure out how to 
get key press events. I even added the key up/down events to the 
widget's event list using the GDK_KEY_PRESS_MASK and 
GDK_KEY_RELEASE_MASK flags passed to gtk_widget_add_events().


Did you add the events to the event mask before the widget was
realized ?

Does the widget in question have keyboard focus at the time
you want to recieve the keyboard events ?

Is the widget in question marked to be focus-capable ?
(i.e. the can-focus bit/property)

Cheers,
                 -Tristan





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