containing the icon.
IconTheme.lookupIcon
gtk.icon_paintable.IconPaintable lookupIcon(string iconName, string[] fallbacks, int size, int scale, gtk.types.TextDirection direction, gtk.types.IconLookupFlags flags)Looks up a named icon for a desired size and window scale, returning a [gtk.icon_paintable.IconPaintable].
The icon can then be rendered by using it as a [gdk.paintable.Paintable], or you can get information such as the filename and size.
If the available 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 [gtk.icon_theme.IconTheme.hasIcon].
Note that you probably want to listen for icon theme changes and update the icon. This is usually done by overriding the GtkWidgetClass.css-changed() function.
Parameters
iconName | the name of the icon to lookup |
fallbacks | |
size | desired icon size. |
scale | the window scale this will be displayed on |
direction | text direction the icon will be displayed in |
flags | flags modifying the behavior of the icon lookup |
Returns
a [gtk.icon_paintable.IconPaintable] object