Package: gtk

Function gtk:icon-source-new

Lambda List

gtk:icon-source-new ()

Return Value

The new gtk:icon-source instance.

Details

Creates a new icon source. A icon source contains a gdk-pixbuf:pixbuf object or image filename that serves as the base image for one or more of the icons in a gtk:icon-set instance, along with a specification for which icons in the icon set will be based on that pixbuf or image file. An icon set contains a set of icons that represent "the same" logical concept in different states, different global text directions, and different sizes.

So for example 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. A gtk:icon-set instance contains a list of gtk:icon-source objects from which it can derive specific icon variants in the set.

In the simplest case, a gtk:icon-set instance contains one source pixbuf from which it derives all variants. The convenience gtk:icon-set-new-from-pixbuf function handles this case. If you only have one source pixbuf, just use that function.

If you want to use a different base pixbuf for different icon variants, you create multiple icon sources, mark which variants they will be used to create, and add them to the icon set with the gtk:icon-set-add-source function.

By default, the icon source has all parameters wildcarded. That is, the icon source will be used as the base icon for any desired text direction, widget state, or icon size.

Warning

The gtk:icon-source-new 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