Where GTK finds icon names to use with gtk_image_new_from_icon_name()?

gtk
grigoryvp picture grigoryvp · Sep 24, 2011 · Viewed 15.3k times · Source

GTK can construct images by name of the "icon from current icon theme". For example:

#!/usr/bin/env python
import gtk; wnd=gtk.Window(); img=gtk.Image();
img.set_from_icon_name( "go-jump", gtk.ICON_SIZE_BUTTON );
wnd.add( img ); img.show(); wnd.show(); gtk.main()

This will display a window with a pretty arrow inside it. But - only on ubuntu. On Windows or OSX it will display window with a "no image" icon inside :(. So my questions is - where GTK keeps icon names like "go-jump"? Is it some list or specification available like for stock icons? Maybe it's some GTK API i can use to list such icons?

Answer

ptomato picture ptomato · Sep 24, 2011

The names are in the Icon Naming Specification. If this doesn't work on Windows or OSX, then report it as a bug - GTK needs at least one icon theme installed in order to work properly.