gtkmm 2.24.2
|
A widget displaying an image. More...
Public Member Functions | |
virtual | ~Image () |
GtkImage* | gobj () |
Provides access to the underlying C GtkObject. | |
const GtkImage* | gobj () const |
Provides access to the underlying C GtkObject. | |
Image () | |
Image (const Glib::RefPtr< Gdk::Pixmap >& pixmap, const Glib::RefPtr< Gdk::Bitmap >& mask) | |
Creates an Image widget displaying pixmap with a mask. | |
Image (const Glib::RefPtr< Gdk::Image >& image, const Glib::RefPtr< Gdk::Bitmap >& mask) | |
Creates an Image widget displaying an image with a mask. | |
Image (const std::string& file) | |
Creates an Image widget displaying the file filename. | |
Image (const Glib::RefPtr< Gdk::Pixbuf >& pixbuf) | |
Creates a new Image widget displaying pixbuf. | |
Image (const IconSet& icon_set, IconSize icon_size) | |
Creates a new Image displaying an icon set. | |
Image (IconSet& icon_set, IconSize icon_size) | |
Image (const Gtk::StockID& stock_id, IconSize size) | |
Creates am Image displaying a stock icon. | |
Image (const Glib::RefPtr< Gdk::PixbufAnimation >& animation) | |
void | set (const Glib::RefPtr< Gdk::Pixmap >& pixmap, const Glib::RefPtr< Gdk::Bitmap >& mask) |
See the Image::Image(const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask) constructor for details. | |
void | set (const Glib::RefPtr< Gdk::Image >& gdk_image, const Glib::RefPtr< Gdk::Bitmap >& mask) |
See the Image::Image(const Glib::RefPtr<Gdk::Image>& image, const Glib::RefPtr<Gdk::Bitmap>& mask) constructor for details. | |
void | set (const std::string& filename) |
See the Image::Image(const std::string& file) constructor for details. | |
void | set (const Glib::RefPtr< Gdk::Pixbuf >& pixbuf) |
See the Image::Image(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf) constructor for details. | |
void | set (const Gtk::StockID& stock_id, IconSize size) |
See the Image::Image(const Gtk::StockID& stock_id, IconSize size) constructor for details. | |
void | set (IconSet& icon_set, IconSize size) |
See new_from_icon_set() for details. | |
void | set (const IconSet& icon_set, IconSize size) |
See new_from_icon_set() for details. | |
void | set (const Glib::RefPtr< Gdk::PixbufAnimation >& animation) |
Causes the Gtk::Image to display the given animation (or display nothing, if you set the animation to 0 ). | |
void | set (const Glib::RefPtr< const Gio::Icon >& icon, IconSize size) |
See new_from_gicon() for details. | |
void | set_from_icon_name (const Glib::ustring& icon_name, IconSize size) |
Causes the Image to display an icon from the current icon theme. | |
void | clear () |
Resets the image to be empty. | |
ImageType | get_storage_type () const |
Gets the type of representation being used by the Gtk::Image to store image data. | |
void | get_pixmap (Glib::RefPtr< Gdk::Pixmap >& pixmap, Glib::RefPtr< Gdk::Bitmap >& mask) const |
void | get_image (Glib::RefPtr< Gdk::Image >& gdk_image, Glib::RefPtr< Gdk::Bitmap >& mask) const |
Glib::RefPtr< Gdk::Pixbuf > | get_pixbuf () |
Gets the Gdk::Pixbuf being displayed by the Gtk::Image. | |
Glib::RefPtr< const Gdk::Pixbuf > | get_pixbuf () const |
Gets the Gdk::Pixbuf being displayed by the Gtk::Image. | |
void | get_stock (Gtk::StockID& stock_id, IconSize&size) const |
void | get_icon_set (IconSet& icon_set, IconSize&size) const |
Glib::RefPtr < Gdk::PixbufAnimation > | get_animation () |
Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image. | |
Glib::RefPtr< const Gdk::PixbufAnimation > | get_animation () const |
Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image. | |
Glib::RefPtr< Gio::Icon > | get_gicon (Gtk::IconSize& icon_size) |
Gets the Gio::Icon and size being displayed by the Gtk::Image. | |
Glib::RefPtr< const Gio::Icon > | get_gicon (Gtk::IconSize& icon_size) const |
Gets the Gio::Icon and size being displayed by the Gtk::Image. | |
Glib::ustring | get_icon_name () const |
Glib::ustring | get_icon_name (IconSize&size) |
int | get_pixel_size () const |
Gets the pixel size used for named icons. | |
void | set_pixel_size (int pixel_size) |
Sets the pixel size to use for named icons. | |
Glib::PropertyProxy < Glib::RefPtr< Gdk::Pixbuf > > | property_pixbuf () |
A GdkPixbuf to display. | |
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< Gdk::Pixbuf > > | property_pixbuf () const |
A GdkPixbuf to display. | |
Glib::PropertyProxy < Glib::RefPtr< Gdk::Pixmap > > | property_pixmap () |
A GdkPixmap to display. | |
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< Gdk::Pixmap > > | property_pixmap () const |
A GdkPixmap to display. | |
Glib::PropertyProxy < Glib::RefPtr< Gdk::Image > > | property_image () |
A GdkImage to display. | |
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< Gdk::Image > > | property_image () const |
A GdkImage to display. | |
Glib::PropertyProxy < Glib::RefPtr< Gdk::Pixmap > > | property_mask () |
Mask bitmap to use with GdkImage or GdkPixmap. | |
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< Gdk::Pixmap > > | property_mask () const |
Mask bitmap to use with GdkImage or GdkPixmap. | |
Glib::PropertyProxy < Glib::ustring > | property_file () |
Filename to load and display. | |
Glib::PropertyProxy_ReadOnly < Glib::ustring > | property_file () const |
Filename to load and display. | |
Glib::PropertyProxy < Glib::ustring > | property_stock () |
Stock ID for a stock image to display. | |
Glib::PropertyProxy_ReadOnly < Glib::ustring > | property_stock () const |
Stock ID for a stock image to display. | |
Glib::PropertyProxy< Gtk::IconSet > | property_icon_set () |
Icon set to display. | |
Glib::PropertyProxy_ReadOnly < Gtk::IconSet > | property_icon_set () const |
Icon set to display. | |
Glib::PropertyProxy< int > | property_icon_size () |
Symbolic size to use for stock icon, icon set or named icon. | |
Glib::PropertyProxy_ReadOnly< int > | property_icon_size () const |
Symbolic size to use for stock icon, icon set or named icon. | |
Glib::PropertyProxy< int > | property_pixel_size () |
Pixel size to use for named icon. | |
Glib::PropertyProxy_ReadOnly< int > | property_pixel_size () const |
Pixel size to use for named icon. | |
Glib::PropertyProxy < Glib::RefPtr < Gdk::PixbufAnimation > > | property_pixbuf_animation () |
GdkPixbufAnimation to display. | |
Glib::PropertyProxy_ReadOnly < Glib::RefPtr < Gdk::PixbufAnimation > > | property_pixbuf_animation () const |
GdkPixbufAnimation to display. | |
Glib::PropertyProxy < Glib::ustring > | property_icon_name () |
The name of the icon from the icon theme. | |
Glib::PropertyProxy_ReadOnly < Glib::ustring > | property_icon_name () const |
The name of the icon from the icon theme. | |
Glib::PropertyProxy_ReadOnly < ImageType > | property_storage_type () const |
The representation being used for image data. | |
Glib::PropertyProxy < Glib::RefPtr< Gio::Icon > > | property_gicon () |
The GIcon being displayed. | |
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< Gio::Icon > > | property_gicon () const |
The GIcon being displayed. | |
Related Functions | |
(Note that these are not member functions.) | |
Gtk::Image* | wrap (GtkImage* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
A widget displaying an image.
The Gtk::Image widget displays an image. Various kinds of object can be displayed as an image; most typically, you would load a Gdk::Pixbuf ("pixel buffer") from a file, and then display that.
Gtk::Image is a subclass of Gtk::Misc, which implies that you can align it (center, left, right) and add padding to it, using Gtk::Misc methods.
Gtk::Image is a "no window" widget (has no Gdk::Window of its own), so by default does not receive events. If you want to receive events on the image, such as button clicks, place the image inside a Gtk::EventBox, then connect to the event signals on the event box.
The Image widget looks like this:
virtual Gtk::Image::~Image | ( | ) | [virtual] |
Gtk::Image::Image | ( | ) |
Gtk::Image::Image | ( | const Glib::RefPtr< Gdk::Pixmap >& | pixmap, |
const Glib::RefPtr< Gdk::Bitmap >& | mask | ||
) | [explicit] |
Creates an Image widget displaying pixmap with a mask.
A Gdk::Pixmap is a server-side image buffer in the pixel format of the current display.
pixmap | A Gdk::Pixmap |
mask | A Gdk::Bitmap |
Gtk::Image::Image | ( | const Glib::RefPtr< Gdk::Image >& | image, |
const Glib::RefPtr< Gdk::Bitmap >& | mask | ||
) | [explicit] |
Creates an Image widget displaying an image with a mask.
A Gdk::Image is a client-side image buffer in the pixel format of the current display.
Gtk::Image::Image | ( | const std::string & | file | ) | [explicit] |
Creates an Image widget 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.
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::create_from_file() to load the file yourself, then create the GtkImage from the pixbuf. (Or for animations, use Gdk::PixbufAnimation::create_from_file()).
The storage type (get_storage_type()) of the returned image is not defined. It will be whatever is appropriate for displaying the file.
Gtk::Image::Image | ( | const Glib::RefPtr< Gdk::Pixbuf >& | pixbuf | ) | [explicit] |
Creates a new Image widget displaying pixbuf.
Note that this just creates an GtkImage from the pixbuf. The Gtk::Image created will not react to state changes. Should you want that, you should use the constructor that takes an IconSet.
Creates a new Image displaying an icon set.
Sample stock sizes are ICON_SIZE_MENU, ICON_SIZE_SMALL_TOOLBAR. Instead of using this function, usually it's better to create an IconFactory, put your icon sets in the icon factory, add the icon factory to the list of default factories with IconFactory::add_default(), and then use the constructor that takes a StockID. This will allow themes to override the icon you ship with your application.
icon_set | An IconSet |
size | A stock icon size. |
Gtk::Image::Image | ( | const Gtk::StockID& | stock_id, |
IconSize | size | ||
) |
Creates am Image displaying a stock icon.
Sample stock icon identifiers are Gtk::Stock::OPEN, Gtk::Stock::EXIT. Sample stock sizes are Gtk::ICON_SIZE_MENU, Gtk::ICON_SIZE_SMALL_TOOLBAR. If the stock icon name isn't known, a "broken image" icon will be displayed instead. You can register your own stock icon names - see Gtk::IconFactory::add().
stock_id | A stock icon. |
size | A stock icon size. |
Gtk::Image::Image | ( | const Glib::RefPtr< Gdk::PixbufAnimation >& | animation | ) |
void Gtk::Image::clear | ( | ) |
Resets the image to be empty.
Glib::RefPtr<Gdk::PixbufAnimation> Gtk::Image::get_animation | ( | ) |
Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image.
The storage type of the image must be Gtk::IMAGE_EMPTY or Gtk::IMAGE_ANIMATION (see get_storage_type()). The caller of this function does not own a reference to the returned animation.
0
if the image is empty. Glib::RefPtr<const Gdk::PixbufAnimation> Gtk::Image::get_animation | ( | ) | const |
Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image.
The storage type of the image must be Gtk::IMAGE_EMPTY or Gtk::IMAGE_ANIMATION (see get_storage_type()). The caller of this function does not own a reference to the returned animation.
0
if the image is empty. Glib::RefPtr<Gio::Icon> Gtk::Image::get_gicon | ( | Gtk::IconSize& | icon_size | ) |
Gets the Gio::Icon and size being displayed by the Gtk::Image.
The storage type of the image must be IMAGE_EMPTY or IMAGE_GICON (see get_storage_type()).
icon_size | A place to store an icon size. |
Glib::RefPtr<const Gio::Icon> Gtk::Image::get_gicon | ( | Gtk::IconSize& | icon_size | ) | const |
Gets the Gio::Icon and size being displayed by the Gtk::Image.
The storage type of the image must be IMAGE_EMPTY or IMAGE_GICON (see get_storage_type()).
icon_size | A place to store an icon size. |
Glib::ustring Gtk::Image::get_icon_name | ( | ) | const |
Glib::ustring Gtk::Image::get_icon_name | ( | IconSize& | size | ) |
void Gtk::Image::get_image | ( | Glib::RefPtr< Gdk::Image >& | gdk_image, |
Glib::RefPtr< Gdk::Bitmap >& | mask | ||
) | const |
Glib::RefPtr<Gdk::Pixbuf> Gtk::Image::get_pixbuf | ( | ) |
Gets the Gdk::Pixbuf being displayed by the Gtk::Image.
The storage type of the image must be Gtk::IMAGE_EMPTY or Gtk::IMAGE_PIXBUF (see get_storage_type()). The caller of this function does not own a reference to the returned pixbuf.
0
if the image is empty. Glib::RefPtr<const Gdk::Pixbuf> Gtk::Image::get_pixbuf | ( | ) | const |
Gets the Gdk::Pixbuf being displayed by the Gtk::Image.
The storage type of the image must be Gtk::IMAGE_EMPTY or Gtk::IMAGE_PIXBUF (see get_storage_type()). The caller of this function does not own a reference to the returned pixbuf.
0
if the image is empty. int Gtk::Image::get_pixel_size | ( | ) | const |
Gets the pixel size used for named icons.
void Gtk::Image::get_pixmap | ( | Glib::RefPtr< Gdk::Pixmap >& | pixmap, |
Glib::RefPtr< Gdk::Bitmap >& | mask | ||
) | const |
void Gtk::Image::get_stock | ( | Gtk::StockID& | stock_id, |
IconSize& | size | ||
) | const |
ImageType Gtk::Image::get_storage_type | ( | ) | const |
Gets the type of representation being used by the Gtk::Image to store image data.
If the Gtk::Image has no image data, the return value will be Gtk::IMAGE_EMPTY.
const GtkImage* Gtk::Image::gobj | ( | ) | const [inline] |
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Misc.
GtkImage* Gtk::Image::gobj | ( | ) | [inline] |
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Misc.
Glib::PropertyProxy<Glib::ustring> Gtk::Image::property_file | ( | ) |
Filename to load and display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Glib::ustring> Gtk::Image::property_file | ( | ) | const |
Filename to load and display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gio::Icon> > Gtk::Image::property_gicon | ( | ) | const |
The GIcon being displayed.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Glib::RefPtr<Gio::Icon> > Gtk::Image::property_gicon | ( | ) |
The GIcon being displayed.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::ustring> Gtk::Image::property_icon_name | ( | ) |
The name of the icon from the icon theme.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Glib::ustring> Gtk::Image::property_icon_name | ( | ) | const |
The name of the icon from the icon theme.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Gtk::IconSet> Gtk::Image::property_icon_set | ( | ) |
Icon set to display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Gtk::IconSet> Gtk::Image::property_icon_set | ( | ) | const |
Icon set to display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<int> Gtk::Image::property_icon_size | ( | ) | const |
Symbolic size to use for stock icon, icon set or named icon.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<int> Gtk::Image::property_icon_size | ( | ) |
Symbolic size to use for stock icon, icon set or named icon.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Glib::RefPtr<Gdk::Image> > Gtk::Image::property_image | ( | ) |
A GdkImage to display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Image> > Gtk::Image::property_image | ( | ) | const |
A GdkImage to display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixmap> > Gtk::Image::property_mask | ( | ) |
Mask bitmap to use with GdkImage or GdkPixmap.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixmap> > Gtk::Image::property_mask | ( | ) | const |
Mask bitmap to use with GdkImage or GdkPixmap.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixbuf> > Gtk::Image::property_pixbuf | ( | ) |
A GdkPixbuf to display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixbuf> > Gtk::Image::property_pixbuf | ( | ) | const |
A GdkPixbuf to display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Glib::RefPtr<Gdk::PixbufAnimation> > Gtk::Image::property_pixbuf_animation | ( | ) |
GdkPixbufAnimation to display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::PixbufAnimation> > Gtk::Image::property_pixbuf_animation | ( | ) | const |
GdkPixbufAnimation to display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<int> Gtk::Image::property_pixel_size | ( | ) | const |
Pixel size to use for named icon.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<int> Gtk::Image::property_pixel_size | ( | ) |
Pixel size to use for named icon.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixmap> > Gtk::Image::property_pixmap | ( | ) | const |
A GdkPixmap to display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixmap> > Gtk::Image::property_pixmap | ( | ) |
A GdkPixmap to display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<Glib::ustring> Gtk::Image::property_stock | ( | ) |
Stock ID for a stock image to display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<Glib::ustring> Gtk::Image::property_stock | ( | ) | const |
Stock ID for a stock image to display.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<ImageType> Gtk::Image::property_storage_type | ( | ) | const |
The representation being used for image data.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
void Gtk::Image::set | ( | const std::string & | filename | ) |
See the Image::Image(const std::string& file) constructor for details.
filename | A filename. |
void Gtk::Image::set | ( | const Glib::RefPtr< const Gio::Icon > & | icon, |
IconSize | size | ||
) |
void Gtk::Image::set | ( | const Glib::RefPtr< Gdk::Pixmap >& | pixmap, |
const Glib::RefPtr< Gdk::Bitmap >& | mask | ||
) |
See the Image::Image(const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask) constructor for details.
pixmap | A Gdk::Pixmap. |
mask | A Gdk::Bitmap. |
See new_from_icon_set() for details.
icon_set | A Gtk::IconSet. |
size | A stock icon size. |
void Gtk::Image::set | ( | const Glib::RefPtr< Gdk::Image >& | gdk_image, |
const Glib::RefPtr< Gdk::Bitmap >& | mask | ||
) |
See the Image::Image(const Glib::RefPtr<Gdk::Image>& image, const Glib::RefPtr<Gdk::Bitmap>& mask) constructor for details.
gdk_image | A Gdk::Image. |
mask | A Gdk::Bitmap. |
void Gtk::Image::set | ( | const Glib::RefPtr< Gdk::PixbufAnimation >& | animation | ) |
Causes the Gtk::Image to display the given animation (or display nothing, if you set the animation to 0
).
animation | The Gdk::PixbufAnimation. |
void Gtk::Image::set | ( | const Glib::RefPtr< Gdk::Pixbuf >& | pixbuf | ) |
See the Image::Image(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf) constructor for details.
pixbuf | A Gdk::Pixbuf. |
void Gtk::Image::set | ( | const Gtk::StockID& | stock_id, |
IconSize | size | ||
) |
See the Image::Image(const Gtk::StockID& stock_id, IconSize size) constructor for details.
stock_id | A stock icon name. |
size | A stock icon size. |
See new_from_icon_set() for details.
icon_set | A Gtk::IconSet. |
size | A stock icon size. |
void Gtk::Image::set_from_icon_name | ( | const Glib::ustring & | icon_name, |
IconSize | size | ||
) |
Causes the Image to display 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.
icon_name | An icon name. |
size | A stock icon size. |
void Gtk::Image::set_pixel_size | ( | int | pixel_size | ) |
Sets the pixel size to use for named icons.
If the pixel size is set to a value != -1, it is used instead of the icon size set by set_from_icon_name().
pixel_size | The new pixel size. |
Gtk::Image* wrap | ( | GtkImage * | object, |
bool | take_copy = false |
||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |