dpitch40
dpitch40

Reputation: 2691

Warning about missing GTK icon in Python executable

In an executable application I write using Python and PyGTK, popping up a FileChooserDialog gives me this warning:

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 copy from:
        http://icon-theme.freedesktop.org/releases

And the link takes me to an archive that appears to be written for Linux. This warning doesn't inhibit the operation of my program, but it is annoying and I think it is confusing my users. It doesn't happen when I run the application from source, only when I build it into an executable with pyinstaller first. Does anyone know how I can locate this icon?

Upvotes: 2

Views: 2707

Answers (1)

Dario Santomarco
Dario Santomarco

Reputation: 21

I solved but... illogically.. I think.

Theoretically, pygtk should have the full icon set embedded by default, so the real oddity is "why it logs those warning?".

The solution (worked for my four projects):

  1. In the root of your project, there should exists a share folder ( if not, create it ), you have to make these additional subfolders:

    YourProjectRoot / share / icons /hicolor /

  2. Download the official binary icon theme for gnome ( a 12 MB ZIP-file )

  3. Unzip the archive, in gnome-icon-theme_2.24.0-1_win32.zip/share/icons/gnome/ find the file index.theme and copy it to hicolor / folder you created.

That's all

Upvotes: 1

Related Questions