looking for gtk.glade documenation

Dave Cook davecook at nowhere.net
Thu Nov 4 21:34:11 EST 2004


In article <pan.2004.11.05.00.29.30.309127 at yahoo.com>, John Doe wrote:

> does anyone have a website that covers gtk.glade?

I was going to point you to several linuxjournal.com articles, but they are
now restricting them to subscribers.

There's only a few things you need to know:

Creating an XML object:

  xml = gtk.glade.XML("myapp.glade")
  
Getting a widget ref:

  widget = xml.get_widget("foo")
  widgets = xml.get_widget_prefix("foo")
  
Getting a widget name:

  widget_name = gtk.glade.get_widget_name(widget)
  
Connecting callbacks to signals:

  xml.signal_connect("on_foo", on_foo_callback, user_data)
  xml.signal_autoconnect({"on_foo" : on_foo_callback})
  xml.signal_autoconnect(foo_object)
  
The last example reads from foo_object.__dict__ to connect the callback.  

Dave Cook



More information about the Python-list mailing list