[pygtk] Glade, event handlers, & gtk.Builder question

Adam Tauno Williams awilliam at whitemice.org
Wed Feb 9 21:32:23 WST 2011


builder = gtk.Builder()
builder.add_from_file(self.gladefile)
self.window = builder.get_object("MainWindow")

This, according to my understanding creates an instance of the
MainWindow widget as defined in the Glade file.

Now if I want to connect the events defined in the Glade file to
handlers of the 'current' instance I perform -

builder.connect_signals(self)

But according to the log messages this tries to connect any event
handler defined in the glade file to methods of this object.  Is there a
way to only connect event handlers for the "MainWindow" widget?  Do I
need to define each widget in a separate Glade file?



More information about the pygtk mailing list