Event propogation problem




Hi all,
I'm having some problems with (key) events being propagated when I don't
think they should be.  I have two specific cases that both seem to show
the same sort of problem.

The first case is from Havocs FAQ 
(http://developer.gnome.org/doc/GGAD/faqs.html), regarding the use of the
arrow keys ("I want to use the arrow keys as a control ...")
The FAQ describes how the event is dispatched to the focus widget, and
if its signal handler returns TRUE, then the event will not be propagated.
This is what I'm doing in my code, but the focus widget is changed
anyways, indicating that the event did, in fact, propogate to the toplevel
GtkWindow.

In the second case, I have a key snooper installed 
(gtk_key_snooper_install()), looking for the Escape key.  However, in my
application, this sniffer should only be looking for the key if nothing
else has responded to the key.  This is handled in my code via the signal
handler callback.  If it responded to the key, the callback will return
true, indicating that the event should not be propaged any further.
However, even though I do return TRUE, the sniffer callback is called
anyways.

I tried to step through the code, but quickly became lost.  The key areas
seemed to be in gtk_window_key_press_event() (gtkwindow.c) and/or
gtk_widget_event() (gtkwidget.c).  It seemed that the TRUE I was returning
had become a FALSE (but I'm not sure...)

Does anyone have any suggestions or ideas?  Does anyone want to see some
sample code?  Does anyone know what I should be watching for when stepping
through the source code?

Any help would be appreciated!
Ian Britten
gtk+-1.2.6-1 (RPM), RedHat 6.0



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