Re: Having an event box pass unhandled events to its child
- From: Dov Grobgeld <dov grobgeld gmail com>
- To: Chris Vine <chris cvine freeserve co uk>
- Cc: gtk-list gnome org
- Subject: Re: Having an event box pass unhandled events to its child
- Date: Tue, 26 May 2009 06:27:47 +0300
Thanks! Now this is obvious. I should have thought of that. All that is needed is to look at the gtkfilechooserbutton.h or the .c file for that matter. The code you suggested works fine for my purpose, i.e. to add a right click menu to any widget. I might amend it to do a recursive descent on any GTK_CONTAINER.
2009/5/26 Chris Vine <chris cvine freeserve co uk>
On Mon, 25 May 2009 06:46:34 +0300
> I did. See my message to the list from 21 May 2009 20:04 with theGtkFileChooserButton is just an GtkHBox object. You need to connect to
> subject "Doing right click on some widgets doesn't work". That
> program creates two buttons. One "normal" and one "file chooser
> button". I attach the same signals to them, but the signal handler
> for button-press-event is never called for the file chooser button. I
> thought I understood signals in gtk by now. But this one beats me...
the widget(s) in the GtkBox which receive events (ie which have a
GdkWindow object). For example amending your code for connecting to
w_fs_button to this works:
GList* children =
for (children = g_list_first(children); children; children =
G_CALLBACK(cb_button_press_event), NULL);However, I suggest you are a little more discriminating and look at the
code for GtkFileChooserButton to find out which widget in particular is
receiving events and connect to that one.
] [Thread Prev