[pygtk] GNOME stock icons in glade
Christopher Backhouse
cjbackhouse at gmail.com
Sun Sep 23 06:22:46 WST 2007
I want to use a GNOME stock icon in my application that uses glade.
The problem I have is that GNOME icons display fine in glade, but don't =
show up when I load the glade file in python.
Google vaguely hinted (e.g. =
http://faq.pygtk.org/index.py?req=3Dshow&file=3Dfaq09.003.htp) that I =
somehow have to enable GNOME support. I remember older versions of glade =
had the choice between gtk and gnome projects - that no longer seems to =
exist in glade 3. I also tried calling gnome.init() in my python code =
with no success.
The test program below (and attached) ought to display (in my icon theme =
at least) a blue 'i' symbol, and a yellow star. The 'i' (gtk stock icon) =
appears, but not the star (GNOME stock icon).
import gtk.glade
xml=3Dgtk.glade.XML('gnomeiconstest.glade')
xml.get_widget('win').connect('destroy',gtk.main_quit)
gtk.main()
<?xml version=3D"1.0" encoding=3D"UTF-8" standalone=3D"no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<glade-interface>
<widget class=3D"GtkWindow" id=3D"win">
<property name=3D"width_request">100</property>
<property name=3D"height_request">100</property>
<property name=3D"visible">True</property>
<child>
<widget class=3D"GtkHBox" id=3D"hbox">
<property name=3D"visible">True</property>
<child>
<widget class=3D"GtkImage" id=3D"gtkimage">
<property name=3D"visible">True</property>
<property name=3D"stock">gtk-about</property>
</widget>
</child>
<child>
<widget class=3D"GtkImage" id=3D"gnomeimage">
<property name=3D"visible">True</property>
<property name=3D"stock">gnome-stock-about</property>
</widget>
</child>
</widget>
</child>
</widget>
</glade-interface>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnomeiconstest.glade
Type: application/x-glade
Size: 902 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20070922/90b95cc0/g=
nomeiconstest.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnomeicontest.py
Type: text/x-python
Size: 127 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20070922/90b95cc0/g=
nomeicontest.py
More information about the pygtk
mailing list