Torsten's answer is correct, but a little incomplete, so in the spirit of http://xkcd.com/979/ here is the procedure I recently settled on after much trial-and-error:
Open yada.glade in Glade interface designer. Go to edit->project and change the project type to GtkBuilder and make sure it targets the latest version (2.24 as of this writing). Save the file, being sure that it saves in GtkBuilder format, and change the name from yada.glade to yada.ui
Open yada.py and change the following code:
gladefile = relativize_filename(os.path.join("glade", "yada.glade"))
self.wTree = gtk.glade.XML(gladefile, self.windowname)
to:
uifile = relativize_filename(os.path.join("glade", "yada.ui"))
self.wTree = gtk.Builder()
self.wTree.add_from_file(uifile)
Similarly change all instances of self.wTree.get_widget(...)
to self.wTree.get_object(...)
Change self.wTree.signal_autoconnect(dic)
to self.wTree.connect_signals(dic)
If your code depends on the name assigned the widget in the interface designer, change widget.get_name()
to gtk.Buildable.get_name(widget)
. widget.get_name()
now just returns the widget type. EDIT: You also need to change widget.set_name('my_widget')
to gtk.Buildable.set_name(widget, 'my_widget')
.
Delete import gtk.glade
I found numerous unused signals defined in the yada.ui xml file, I had to open the xml file and manually delete them to eliminate the warnings they caused.