[pygtk] Problem with load_icon() on Windows

Gaëtan gpodevij at gmail.com
Sat Oct 23 00:26:24 WST 2010


I have installed PyGTK on Windows and it seems to work correctly (The test
on pygtk.org's FAQ works).

Unfortunately, I have a problem when I use load_icon method to add an theme
icon in an IconView.

Here is the piece of code :

self.fileIcon = self.get_icon(gtk.STOCK_FILE)
self.dirIcon = self.get_icon(gtk.STOCK_OPEN)

 def get_icon(self, name):
       theme = gtk.icon_theme_get_default()
       return theme.load_icon(name, 48, 0)

The code comes from

There error raised is :

GtkWarning: Could not find the icon'gtk-file'. The 'hicolor' theme was not
found either; perhaps you need to install it. You can get a copu from:
return theme.load_icon(name, 48, 0)
Traceback (most recent call last):
File "C:\Users\herlock\dev\iconview.py", line 122, in (module) PyApp()
File "C:\Users\herlock\dev\iconview.py", line 40, in __init__ self.fileIcon
= self.get_icon(gtk.STOCK_FILE)
File "C:\Users\herlock\dev\iconview.py", line 69; in get_icon return
theme.load_icon(name, 48, 0)
glib.GError: Icon 'gtk-icon' not present in theme

Have you got any idea of what should I do ? The hicolor packages from
icon-theme.freedesktop.org looks like to be for Unix.

I really need to develop in pygtk on Windows and it'll help me a lot to find
the solution !

Thank you,
Gaëtan Podevijn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20101022/da732b58/attachment.html>

More information about the pygtk mailing list