Extending PyGTK widgets with Glade

Richard Carlson rcarlson.cs at gmail.com
Fri Jan 20 11:38:17 EST 2012


I'm working on a program using PyGTK and Glade.  I create a glade XML file
using Glade Designer and then load widgets like this:

class MyDialog:
    def __init__(self):
        self.dialog = gtk.glade.XML(self.GLADEFILE).get_widget
("dialog.xml")

I think it would be better if I extended the Dialog class, but I can't 
figure out how to do it.  I'd like to do something like this:

class MyDialog(gtk.Dialog):
    def __init__(self):
        self = gtk.glade.XML(self.GLADEFILE).get_widget("example_dialog")

Can someone point me in the right direction?

Thanks,

Richard



More information about the Python-list mailing list