Christian Reis <[EMAIL PROTECTED]> writes: > On Tue, Nov 12, 2002 at 08:33:20AM +0100, Andreas Degert wrote: > > With gtk1/gnome1, binding the signals seems to happen when a > > widget-tree is added to the AppletWidget container. So, if you add > > "binding the signals"? Do you mean connect() itself, or something else? > > > Buttons to a GtkHBox, and then add that box to the AppletWidget, the > > button-events are processed by the panel. If you first add the > > GtkHBox, and then add the buttons to the GtkHBox, then those buttons > > receive events button2 and button3. Some explicit mechanism for gnome2 > > to bind the signals would be better. > > I'm not entirely sure I understand (or agree) with what you describe? It > could just be that the hierarchy through which the signal propagates is > killing the signal somewhere, or some handler is not doing what it should. > > AFAIK, it shouldn't matter at all the order in which the widgets are > composed.
ok, I took some time and checked it with the source. All of this is only valid for gtk1 and gnome1 (at least I haven't checked what changed in gnome2). The class AppletWidget in module applet.py has a method "add_full" to add the widget-tree for the applet into the AppletWidget: add_full(self, child, bind_events) This corresponds to the c-function "applet_widget_add_full" in the file applet-widget.c. "bind_events" is a boolean parameter. If set, the function "bind_applet_events" is called at the end of function. It recursivly connects the signal-handler applet_event to the signal "event" to each widget (with a window) in the widget-tree. The python method "add" is equivalent to "add_full" with bind_events set to true. There is also a separate method "bind_events". So, it seems to be cleaner to call "add_full" with the bind-events parameter set to false, and then call "bind_events" explicitely at some point, because it affects all widgets it finds in the tree. If you use "add", you get the order-dependency as a consequence of that side-effect. _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/