Examples:
image = Gtk::Image.new
Create an image from a file.
image = Gtk::Image.new(file: 'path/to/the/image.png')
Create an image from icon name.
image = Gtk::Image.new(icon_name: 'gtk-open')
Create an image from a Gio::Icon, that itself is loaded from a
file.
Create an image from from a Gio::Icon that is an Gio::ThemedIcon.
icon = Gio::ThemedIcon.new 'gtk-open'
image = Gtk::Image.new(icon: icon)
Create an image from a GdkPixbuf::Pixbuf.
pixbuf = GdkPixbuf::Pixbuf.new(:file => 'path/to/the/image.png')
image = Gtk::Image.new(pixbuf: pixbuf)
Create an image from a file in a resource file
resource = Gio::Resource.load(a_resource_file)
Gio::Resources.register(resource)
resource_path = "/path/to/image.png"
image = Gtk::Image.new(resource: resource_path)