After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 554301 - Allow calling connect_signals multiple times
Allow calling connect_signals multiple times
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Class: GtkBuilder
2.12.x
Other All
: Normal enhancement
: ---
Assigned To: GtkBuilder maintainers
GtkBuilder maintainers
Depends on:
Blocks:
 
 
Reported: 2008-09-29 14:07 UTC by Benjamin E.
Modified: 2018-04-14 23:56 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Benjamin E. 2008-09-29 14:07:31 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
Comment 1 alexandre.nunes 2015-10-22 18:38:32 UTC
Wow, how come this had no attention after all these years?
Comment 2 Matthias Clasen 2018-02-10 05:11:53 UTC
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.
Comment 3 Matthias Clasen 2018-04-14 23:56:37 UTC
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