[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-app-devel
Subject:    Re: key press in drawing area
From:       Havoc Pennington <rhp () zirx ! pair ! com>
Date:       1999-07-08 1:28:51
[Download RAW message or body]


Hi,

Key events go to the "focus widget." They originate on the toplevel
GtkWindow, which reroutes them to the widget with the focus.

Drawing areas won't become the focus widget by default. I think you will
probably need to set the GTK_CAN_FOCUS flag:

GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS);

Then you'll want to set the GTK_HAS_FOCUS flag when you get a
focus_in_event and unset it when you get focus_out_event. 

Finally, you might want to gtk_widget_grab_focus() when the user clicks
the mouse on the drawing area. Users can also move the focus to your
drawing area with the arrow keys or Tab.

Havoc




-- 
         To unsubscribe: mail gtk-app-devel-list-request@redhat.com with 
                       "unsubscribe" as the Subject.

	Mailing list concerns should be mailed to <listmaster@redhat.com>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic