Re: Events and derived objects
- From: Tristan Van Berkom <tristan van berkom gmail com>
- To: Eduardo M KALINOWSKI <ekalin bol com br>
- Cc: Gtk <gtk-app-devel-list gnome org>
- Subject: Re: Events and derived objects
- Date: Fri, 16 Dec 2005 09:50:32 -0500
Eduardo M KALINOWSKI wrote:
However, I find that solution not nice. The derived object structure
should be considered opaque, for example. I would like to connect the
signal to the derived object iself, not to widgets inside it:
and have the same behaviour as above. Currently, doing it like this
calls the key handler after the default GtkTextView one, and this means
I can only catch keys not handled by the GtkTextView.
What I'm wondering; is how it turns out to be called at all !
Wait a second ! is it because the actual widget is passing an
unhandled key-press-event to its parent widget ? HA!
What you need to do is provide an interface for this in your
derived object, just because GtkBox also has a "key-press-event"
doesn't mean its the *same* key-press-event as the text-view's.
You can use your derived objects key-press-event handler as
a proxy, create a signal with g_signal_new() and filter keys
out by emitting that signal in your key-press-event handler.
That would be a clean implementation.
] [Thread Prev