Package: gtk

Function gtk-icon-theme-load-surface

Lambda List

gtk-icon-theme-load-surface (theme name size scale window flags)

Arguments

theme -- a gtk-icon-theme object
name -- a string with the name of the icon to lookup
size -- an integer with the desired icon size
scale -- an integer with the desired scale
window -- a gdk-window object to optimize drawing for, or nil
flags -- a gtk-icon-lookup-flags value modifying the behavior of the icon lookup

Return Value

The rendered icon as a cairo-surface-t instance.

Details

Looks up an icon in an icon theme for a particular window scale, scales it to the given size and renders it into a Cairo surface. This is a convenience function. If more details about the icon are needed, use the gtk-icon-theme-lookup-icon function followed by the gtk-icon-info-load-surface function.

Note that you probably want to listen for icon theme changes and update the icon. This is usually done by connecting to the "style-updated" signal.
 

See also

2021-11-28