Red Hat 9, Python and Glade - a mixure not working?

David M. Cook davecook at nowhere.net
Sat Jul 5 23:03:05 CEST 2003


In article <c7427279.0307050724.147536d1 at posting.google.com>, Hans Deragon
wrote:

> def on_button4_clicked(source=None, event=None):

You should exit the mainloop here:

        gtk.main_quit()

>   sys.exit();
> 
> gtk.glade.XML('project3.glade')

Should be

xml = gtk.glade.XML('project3.glade')

> xml.autoconnect({
>   'on_button4_clicked': on_button4_clicked
> })

Or you can just use

xml.signal_autoconnect(locals())

See glade_demo.py in the /usr/share/doc/pygtk2-1.99.14/examples/glade/.

For more info on pygtk see

http://www.async.com.br/faq/pygtk/index.py?req=index
http://www.moeraki.com/pygtkreference/pygtk2reference/

Dave Cook




More information about the Python-list mailing list