Package: gtk

Function gtk:icon-theme-lookup-icon

Lambda List

gtk:icon-theme-lookup-icon (theme name fallbacks size scale direction flags)

Arguments

theme -- a gtk:icon-theme object
name -- a string with the name of an icon
fallbacks -- a list of strings with fallback icons
size -- an integer with the desired icon size
scale -- an integer with the window scale this will be displayed on
direction -- a value of the gtk:text-direction enumeration
flags -- a value of the gtk:icon-lookup-flags flags

Return Value

The gtk:icon-paintable object containing the icon.

Details

Looks up a named icon for a desired size and window scale, returning a gtk:icon-paintable object. The icon can then be rendered by using it as a gdk:paintable object, or you can get information such as the filename and size.

If the icon name is not available and fallbacks are provided, they will be tried in order.

If no matching icon is found, then a paintable that renders the "missing icon" icon is returned. If you need to do something else for missing icons you need to use the gtk:icon-theme-has-icon function.

Note that you probably want to listen for icon theme changes and update the icon.
 

See also

2024-10-9