AsyncImage is a Gtk.Image that provides a way to load icons and images asynchronously without blocking the
main GTK thread.
AsyncImage can be used to improve your GTK interface's performance that has a lot of images to load and populate e.g: the applications
menu and an icon chooser.
AsyncImage internally operates only on Gdk.Pixbuf and Cairo.Surface's which means
that you cannot read valid properties from the main Gtk.Image like Gtk.Image.icon_name
, Gtk.Image.gicon or Gtk.Image.file. The only property which will be
set is the final surface: Gtk.Image.surface.
Even though AsyncImage sets only the Gtk.Image.surface, it automatically detects changes to the underlying
Gtk.Widget.scale_factor and reloads the icon to a new scale factor when it changes. If you request to set an
GLib.ThemedIcon and the icon or GTK theme changes the AsyncImage will also reload it to display the new icon
with applied changes.
AsyncImage has also its own cache for already loaded icons. If you attempt to load the same icon at the same size AsyncImage will look it
up and if it's available, will set it immediately.
If you want to detect when the image was actually loaded into the Cairo.Surface you can connect to the
GLib.Object.notify signal for Gtk.Image.surface.