The main reason for using a name rather than simply providing a filename
is to allow different icons to be used depending on what “icon theme” is
selected by the user. The operation of icon themes on Linux and Unix
follows the Icon Theme Specification
There is a fallback icon theme, named hicolor, where applications
should install their icons, but additional icon themes can be installed
as operating system vendors and users choose.
In many cases, named themes are used indirectly, via gtk.image.Image
rather than directly, but looking up icons directly is also simple. The
gtk.icon_theme.IconTheme object acts as a database of all the icons in the current
theme. You can create new gtk.icon_theme.IconTheme objects, but it’s much more
efficient to use the standard icon theme of the gtk.widget.Widget so that the
icon information is shared with other people looking up icons.
gtk.icon_theme.IconTheme provides a facility for loading themed icons.
The main reason for using a name rather than simply providing a filename is to allow different icons to be used depending on what “icon theme” is selected by the user. The operation of icon themes on Linux and Unix follows the Icon Theme Specification There is a fallback icon theme, named hicolor, where applications should install their icons, but additional icon themes can be installed as operating system vendors and users choose.
In many cases, named themes are used indirectly, via gtk.image.Image rather than directly, but looking up icons directly is also simple. The gtk.icon_theme.IconTheme object acts as a database of all the icons in the current theme. You can create new gtk.icon_theme.IconTheme objects, but it’s much more efficient to use the standard icon theme of the gtk.widget.Widget so that the icon information is shared with other people looking up icons.