Package: gtk

Function gtk:icon-set-add-source

Lambda List

gtk:icon-set-add-source (iconset source)

Arguments

iconset -- a gtk:icon-set instance
source -- a gtk:icon-source instance

Details

This function copies source, so you can reuse the same source immediately without affecting the icon set. Icon sets have a list of gtk:icon-source instances, which they use as base icons for rendering icons in different states and sizes. Icons are scaled, made to look insensitive, etc. in the gtk:icon-set-render-icon function, but a gtk:icon-set instance needs base images to work with. The base images and when to use them are described by a gtk:icon-source instance.

An example of when you would use this function: a web browser's "Back to Previous Page" icon might point in a different direction in Hebrew and in English. It might look different when insensitive, and it might change size depending on toolbar mode (small/large icons). So a single icon set would contain all those variants of the icon, and you might add a separate source for each one.

You should nearly always add a "default" icon source with all fields wildcarded, which will be used as a fallback if no more specific source matches. A gtk:icon-set instance always prefers more specific icon sources to more generic icon sources. The order in which you add the sources to the icon set does not matter.

The gtk:icon-set-new-from-pixbuf function creates a new icon set with a default icon source based on the given pixbuf.

Warning

The gtk:icon-set-add-source function has been deprecated since version 3.10 and should not be used in newly written code. Use the gtk:icon-theme API instead.
 

See also

#2023-3-27