GNOME Bugzilla – Bug 554301
Allow calling connect_signals multiple times
Last modified: 2018-04-14 23:56:37 UTC
I use PyGTK and gtk.Builder for my application. I want to be able to call connect_signals multiple times, because I created a class for every dialog, in which I want the signal handlers to be placed. I looked at the original C code, but I did not understand it completely (that's why I'm using PyGTK). So I don't know whether this is possible or not. Example code: import gtk class FirstWindow: def __init__(self, builder): builder.connect_signals(self) def on_button1_clicked(self, widget, data=None): print "Button 1 clicked." class SecondWindow: def __init__(self, builder): builder.connect_signals(self) def on_button2_clicked(self, widget, data=None): print "Button 2 clicked." builder = gtk.Builder() builder.add_from_file("ui.xml") firstwindow = FirstWindow(builder) secondwindow = SecondWindow(builder) builder.get_object("firstwindow").show() builder.get_object("secondwindow").show() gtk.main() # When clicking each button once, the output is: # >> Button 1 clicked
Wow, how come this had no attention after all these years?
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla. If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab: https://gitlab.gnome.org/GNOME/gtk/issues/new