[pygtk] Accessing child widgets via instance variables
Drew Vogel
dvogel at intercarve.net
Tue Aug 26 22:27:09 WST 2008
I have a glade file with a gtk.Window named my_win. It has a gtk.Button
on it named my_btn. When I call:
my_win = wtree.get_widget("my_win")
I want to be able to access my_btn as:
my_win.my_btn
Is there a way to make PyGTK enable this access pattern by creating
instance variables for child widgets automatically? I tried inspecting
the PyGladeXML object, but __dict__ is empty. I suspect that is because
it is in the C libglade.
I found a Linux Journal article[1] that discusses a package named
GladeBase.UI but that is from 2001, targeted at Python 2.1b1 and Glade
0.5.11. Is GladeBase still relevant?
I'm new to PyGTK and inexperienced with Python, so please correct me if
I've used the wrong terminology.
[1] http://www.linuxjournal.com/article/4702
Drew Vogel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20080826/9170b660/attachment.pgp
More information about the pygtk
mailing list