Re: [gtk-list] Forwarding events to the proper widget



It gets sent to the currently focused widget.  If you want only one widget
to recieve key events keep it focused by attaching a focus callback to all
the other widgets' (if they can recieve focus) GtkWidget::focus_in_event
signal.  This isn't very elegant with lots of widgets, but it works well
if you only have a few...  in my experience the only widgets that you need
to keep focus away from are the GtkText and GtkEntry widgets.  Everything
else doesn't seem to keep focus like they do.

Hope this helps.

Eden Li
tile@primenet.com

On Thu, 15 Jul 1999, David Allen wrote:
|If an event is sent to a GTK program, say through some synthetic program
|the main window of your program is sent a "X" keypress and then an "X" 
|keyrelease, most applications get those, but a lot of times they are 
|ignored because they aren't sent to the right widget.
|
|How do you catch signals that are sent to the window, and forward them to 
|the right widget?  Does GTK have a method of handling this type of thing or
|would it be delving into Xlib, and if so, what book would one recommend for
|the Xlib behind GTK?
|-- 
|David Allen
|http://opop.nols.com/
|----------------------------------------
|"Hex, Bugs, Rock & Roll" -- Bruce Conklin, Space Dynamics Lab, Utah State U.
|
|-- 
|To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
|
|



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