Class: Gtk::Image
- Inherits:
-
Object
- Object
- Gtk::Image
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#animation ⇒ GdkPixbuf::PixbufAnimation
Gets the Gdk::PixbufAnimation being displayed by the #GtkImage.
-
#clear ⇒ nil
Resets the image to be empty.
-
#file ⇒ String
File.
- #file=(file) ⇒ String
-
#from_animation=(animation) ⇒ nil
Causes the Gtk::Image to display the given animation (or display nothing, if you set the animation to nil).
-
#from_file=(filename) ⇒ nil
See gtk_image_new_from_file() for details.
-
#from_pixbuf=(pixbuf) ⇒ nil
See gtk_image_new_from_pixbuf() for details.
-
#from_resource=(resource_path) ⇒ nil
See gtk_image_new_from_resource() for details.
-
#from_surface=(surface) ⇒ nil
See gtk_image_new_from_surface() for details.
-
#get_gicon(gicon, size) ⇒ nil
Gets the #GIcon and size being displayed by the Gtk::Image.
-
#get_icon_name(icon_name, size) ⇒ nil
Gets the icon name and size being displayed by the Gtk::Image.
-
#get_icon_set(icon_set, size) ⇒ nil
Gets the icon set and size being displayed by the Gtk::Image.
-
#get_stock(stock_id, size) ⇒ nil
Gets the stock icon name and size being displayed by the Gtk::Image.
-
#gicon ⇒ Gio::Icon
The GIcon displayed in the GtkImage.
-
#gicon=(gicon) ⇒ Gio::Icon
The GIcon displayed in the GtkImage.
-
#icon_name ⇒ String
The name of the icon in the icon theme.
-
#icon_name=(icon_name) ⇒ String
The name of the icon in the icon theme.
-
#icon_set ⇒ Gtk::IconSet
Icon-set.
- #icon_set=(icon_set) ⇒ Gtk::IconSet
-
#icon_size ⇒ Integer
Icon-size.
- #icon_size=(icon_size) ⇒ Integer
-
#new ⇒ Gtk::Widget
Creates a new empty Gtk::Image widget.
-
#new_from_animation(animation) ⇒ Gtk::Widget
Creates a Gtk::Image displaying the given animation.
-
#new_from_file(filename) ⇒ Gtk::Widget
Creates a new Gtk::Image displaying the file filename.
-
#new_from_gicon(icon, size) ⇒ Gtk::Widget
Creates a Gtk::Image displaying an icon from the current icon theme.
-
#new_from_icon_name(icon_name, size) ⇒ Gtk::Widget
Creates a Gtk::Image displaying an icon from the current icon theme.
-
#new_from_icon_set(icon_set, size) ⇒ Gtk::Widget
Creates a Gtk::Image displaying an icon set.
-
#new_from_pixbuf(pixbuf) ⇒ Gtk::Widget
Creates a new Gtk::Image displaying pixbuf.
-
#new_from_resource(resource_path) ⇒ Gtk::Widget
Creates a new Gtk::Image displaying the resource file resource_path.
-
#new_from_stock(stock_id, size) ⇒ Gtk::Widget
Creates a Gtk::Image displaying a stock icon.
-
#new_from_surface(surface) ⇒ Gtk::Widget
Creates a new Gtk::Image displaying surface.
-
#pixbuf ⇒ GdkPixbuf::Pixbuf
Pixbuf.
- #pixbuf=(pixbuf) ⇒ GdkPixbuf::Pixbuf
-
#pixbuf_animation ⇒ GdkPixbuf::PixbufAnimation
Pixbuf-animation.
- #pixbuf_animation=(pixbuf_animation) ⇒ GdkPixbuf::PixbufAnimation
-
#pixel_size ⇒ Integer
The “pixel-size” property can be used to specify a fixed size overriding the Gtk::Image:icon-size property for images of type %GTK_IMAGE_ICON_NAME.
-
#pixel_size=(pixel_size) ⇒ Integer
The “pixel-size” property can be used to specify a fixed size overriding the Gtk::Image:icon-size property for images of type %GTK_IMAGE_ICON_NAME.
-
#resource ⇒ String
A path to a resource file to display.
-
#resource=(resource) ⇒ String
A path to a resource file to display.
-
#set_from_gicon(icon, size) ⇒ nil
See gtk_image_new_from_gicon() for details.
-
#set_from_icon_name(icon_name, size) ⇒ nil
See gtk_image_new_from_icon_name() for details.
-
#set_from_icon_set(icon_set, size) ⇒ nil
See gtk_image_new_from_icon_set() for details.
-
#set_from_stock(stock_id, size) ⇒ nil
See gtk_image_new_from_stock() for details.
-
#stock ⇒ String
Stock.
- #stock=(stock) ⇒ String
-
#storage_type ⇒ Gtk::ImageType
Storage-type.
- #storage_type=(storage_type) ⇒ Gtk::ImageType
-
#surface ⇒ cairo::Surface
Surface.
- #surface=(surface) ⇒ cairo::Surface
-
#use_fallback=(use_fallback) ⇒ TrueClass
Whether the icon displayed in the GtkImage will use standard icon names fallback.
-
#use_fallback? ⇒ TrueClass
Whether the icon displayed in the GtkImage will use standard icon names fallback.
Instance Method Details
#animation ⇒ GdkPixbuf::PixbufAnimation
Gets the Gdk::PixbufAnimation being displayed by the #GtkImage. The storage type of the image must be %GTK_IMAGE_EMPTY or %GTK_IMAGE_ANIMATION (see gtk_image_get_storage_type()). The caller of this function does not own a reference to the returned animation. the image is empty
#clear ⇒ nil
Resets the image to be empty.
#file ⇒ String
Returns file.
#file=(file) ⇒ String
#from_animation=(animation) ⇒ nil
Causes the Gtk::Image to display the given animation (or display nothing, if you set the animation to nil).
#from_file=(filename) ⇒ nil
See gtk_image_new_from_file() for details.
#from_pixbuf=(pixbuf) ⇒ nil
See gtk_image_new_from_pixbuf() for details.
#from_resource=(resource_path) ⇒ nil
See gtk_image_new_from_resource() for details.
#from_surface=(surface) ⇒ nil
See gtk_image_new_from_surface() for details.
#get_gicon(gicon, size) ⇒ nil
Gets the #GIcon and size being displayed by the Gtk::Image. The storage type of the image must be %GTK_IMAGE_EMPTY or %GTK_IMAGE_GICON (see gtk_image_get_storage_type()). The caller of this function does not own a reference to the returned #GIcon.
#get_icon_name(icon_name, size) ⇒ nil
Gets the icon name and size being displayed by the Gtk::Image. The storage type of the image must be %GTK_IMAGE_EMPTY or %GTK_IMAGE_ICON_NAME (see gtk_image_get_storage_type()). The returned string is owned by the Gtk::Image and should not be freed.
#get_icon_set(icon_set, size) ⇒ nil
Gets the icon set and size being displayed by the Gtk::Image. The storage type of the image must be %GTK_IMAGE_EMPTY or %GTK_IMAGE_ICON_SET (see gtk_image_get_storage_type()).
#get_stock(stock_id, size) ⇒ nil
Gets the stock icon name and size being displayed by the Gtk::Image. The storage type of the image must be %GTK_IMAGE_EMPTY or %GTK_IMAGE_STOCK (see gtk_image_get_storage_type()). The returned string is owned by the Gtk::Image and should not be freed.
#gicon ⇒ Gio::Icon
The GIcon displayed in the GtkImage. For themed icons, If the icon theme is changed, the image will be updated automatically.
#gicon=(gicon) ⇒ Gio::Icon
The GIcon displayed in the GtkImage. For themed icons, If the icon theme is changed, the image will be updated automatically.
#icon_name ⇒ String
The name of the icon in the icon theme. If the icon theme is changed, the image will be updated automatically.
#icon_name=(icon_name) ⇒ String
The name of the icon in the icon theme. If the icon theme is changed, the image will be updated automatically.
#icon_set ⇒ Gtk::IconSet
Returns icon-set.
#icon_set=(icon_set) ⇒ Gtk::IconSet
#icon_size ⇒ Integer
Returns icon-size.
#icon_size=(icon_size) ⇒ Integer
#new ⇒ Gtk::Widget
Creates a new empty Gtk::Image widget.
#new_from_animation(animation) ⇒ Gtk::Widget
Creates a Gtk::Image displaying the given animation. The Gtk::Image does not assume a reference to the animation; you still need to unref it if you own references. Gtk::Image will add its own reference rather than adopting yours.
Note that the animation frames are shown using a timeout with #G_PRIORITY_DEFAULT. When using animations to indicate busyness, keep in mind that the animation will only be shown if the main loop is not busy with something that has a higher priority.
#new_from_file(filename) ⇒ Gtk::Widget
Creates a new Gtk::Image displaying the file filename. If the file isn’t found or can’t be loaded, the resulting Gtk::Image will display a “broken image” icon. This function never returns nil, it always returns a valid Gtk::Image widget.
If the file contains an animation, the image will contain an animation.
If you need to detect failures to load the file, use gdk_pixbuf_new_from_file() to load the file yourself, then create the Gtk::Image from the pixbuf. (Or for animations, use gdk_pixbuf_animation_new_from_file()).
The storage type (gtk_image_get_storage_type()) of the returned image is not defined, it will be whatever is appropriate for displaying the file.
#new_from_gicon(icon, size) ⇒ Gtk::Widget
Creates a Gtk::Image displaying an icon from the current icon theme. If the icon name isn’t known, a “broken image” icon will be displayed instead. If the current icon theme is changed, the icon will be updated appropriately.
#new_from_icon_name(icon_name, size) ⇒ Gtk::Widget
Creates a Gtk::Image displaying an icon from the current icon theme. If the icon name isn’t known, a “broken image” icon will be displayed instead. If the current icon theme is changed, the icon will be updated appropriately.
#new_from_icon_set(icon_set, size) ⇒ Gtk::Widget
Creates a Gtk::Image displaying an icon set. Sample stock sizes are #GTK_ICON_SIZE_MENU, #GTK_ICON_SIZE_SMALL_TOOLBAR. Instead of using this function, usually it’s better to create a Gtk::IconFactory, put your icon sets in the icon factory, add the icon factory to the list of default factories with gtk_icon_factory_add_default(), and then use gtk_image_new_from_stock(). This will allow themes to override the icon you ship with your application.
The Gtk::Image does not assume a reference to the icon set; you still need to unref it if you own references. Gtk::Image will add its own reference rather than adopting yours.
#new_from_pixbuf(pixbuf) ⇒ Gtk::Widget
Creates a new Gtk::Image displaying pixbuf. The Gtk::Image does not assume a reference to the pixbuf; you still need to unref it if you own references. Gtk::Image will add its own reference rather than adopting yours.
Note that this function just creates an Gtk::Image from the pixbuf. The Gtk::Image created will not react to state changes. Should you want that, you should use gtk_image_new_from_icon_name().
#new_from_resource(resource_path) ⇒ Gtk::Widget
Creates a new Gtk::Image displaying the resource file resource_path. If the file isn’t found or can’t be loaded, the resulting Gtk::Image will display a “broken image” icon. This function never returns nil, it always returns a valid Gtk::Image widget.
If the file contains an animation, the image will contain an animation.
If you need to detect failures to load the file, use gdk_pixbuf_new_from_file() to load the file yourself, then create the Gtk::Image from the pixbuf. (Or for animations, use gdk_pixbuf_animation_new_from_file()).
The storage type (gtk_image_get_storage_type()) of the returned image is not defined, it will be whatever is appropriate for displaying the file.
#new_from_stock(stock_id, size) ⇒ Gtk::Widget
Creates a Gtk::Image displaying a stock icon. Sample stock icon names are #GTK_STOCK_OPEN, #GTK_STOCK_QUIT. Sample stock sizes are #GTK_ICON_SIZE_MENU, #GTK_ICON_SIZE_SMALL_TOOLBAR. If the stock icon name isn’t known, the image will be empty. You can register your own stock icon names, see gtk_icon_factory_add_default() and gtk_icon_factory_add().
#new_from_surface(surface) ⇒ Gtk::Widget
Creates a new Gtk::Image displaying surface. The Gtk::Image does not assume a reference to the surface; you still need to unref it if you own references. Gtk::Image will add its own reference rather than adopting yours.
#pixbuf ⇒ GdkPixbuf::Pixbuf
Returns pixbuf.
#pixbuf=(pixbuf) ⇒ GdkPixbuf::Pixbuf
#pixbuf_animation ⇒ GdkPixbuf::PixbufAnimation
Returns pixbuf-animation.
#pixbuf_animation=(pixbuf_animation) ⇒ GdkPixbuf::PixbufAnimation
#pixel_size ⇒ Integer
The “pixel-size” property can be used to specify a fixed size overriding the Gtk::Image:icon-size property for images of type %GTK_IMAGE_ICON_NAME.
#pixel_size=(pixel_size) ⇒ Integer
The “pixel-size” property can be used to specify a fixed size overriding the Gtk::Image:icon-size property for images of type %GTK_IMAGE_ICON_NAME.
#resource ⇒ String
A path to a resource file to display.
#resource=(resource) ⇒ String
A path to a resource file to display.
#set_from_gicon(icon, size) ⇒ nil
See gtk_image_new_from_gicon() for details.
#set_from_icon_name(icon_name, size) ⇒ nil
See gtk_image_new_from_icon_name() for details.
#set_from_icon_set(icon_set, size) ⇒ nil
See gtk_image_new_from_icon_set() for details.
#set_from_stock(stock_id, size) ⇒ nil
See gtk_image_new_from_stock() for details.
#stock ⇒ String
Returns stock.
#stock=(stock) ⇒ String
#storage_type ⇒ Gtk::ImageType
Returns storage-type.
#storage_type=(storage_type) ⇒ Gtk::ImageType
#surface ⇒ cairo::Surface
Returns surface.
#surface=(surface) ⇒ cairo::Surface
#use_fallback=(use_fallback) ⇒ TrueClass
Whether the icon displayed in the GtkImage will use standard icon names fallback. The value of this property is only relevant for images of type %GTK_IMAGE_ICON_NAME and %GTK_IMAGE_GICON.
#use_fallback? ⇒ TrueClass
Whether the icon displayed in the GtkImage will use standard icon names fallback. The value of this property is only relevant for images of type %GTK_IMAGE_ICON_NAME and %GTK_IMAGE_GICON.