logo top
Main Page   Widgets   Namespaces   Book  

Gtk::Image Class Reference
[Widgets]

Inheritance diagram for Gtk::Image:

Inheritance graph
[legend]
List of all members.

Detailed Description

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.


Public Member Functions

void clear ()
Glib::RefPtr<const Gdk::PixbufAnimationget_animation () const
 Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image.
Glib::RefPtr<Gdk::PixbufAnimationget_animation ()
 Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image.
Glib::ustring get_icon_name (IconSize& size)
Glib::ustring get_icon_name () const
void get_icon_set (IconSet& icon_set, IconSize& size) const
void get_image (Glib::RefPtr<Gdk::Image>& gdk_image, Glib::RefPtr<Gdk::Bitmap>& mask) const
Glib::RefPtr<const Gdk::Pixbufget_pixbuf () const
 Gets the Gdk::Pixbuf being displayed by the Gtk::Image.
Glib::RefPtr<Gdk::Pixbufget_pixbuf ()
 Gets the Gdk::Pixbuf being displayed by the Gtk::Image.
int get_pixel_size () const
 Gets the pixel size used for named icons.
void get_pixmap (Glib::RefPtr<Gdk::Pixmap>& pixmap, Glib::RefPtr<Gdk::Bitmap>& mask) const
void get_stock (Gtk::StockID& stock_id, IconSize& size) const
ImageType get_storage_type () const
 Gets the type of representation being used by the Gtk::Image to store image data.
const GtkImage* gobj () const
 Provides access to the underlying C GtkObject.
GtkImage* gobj ()
 Provides access to the underlying C GtkObject.
 Image (const Glib::RefPtr<Gdk::PixbufAnimation>& animation)
 Image (IconSet& icon_set, IconSize size)
 Image (const Gtk::StockID& stock_id, IconSize size)
 Image (const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
 Image (const std::string& file)
 Image (const Glib::RefPtr<Gdk::Image>& image, const Glib::RefPtr<Gdk::Bitmap>& mask)
 Image (const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask)
 Image ()
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 (IconSet& icon_set, IconSize size)
 See new_from_icon_set() for details.
void set (const Gtk::StockID& stock_id, IconSize size)
 See new_from_stock() for details.
void set (const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
 See new_from_pixbuf() for details.
void set (const std::string& filename)
 See new_from_file() for details.
void set (const Glib::RefPtr<Gdk::Image>& gdk_image, const Glib::RefPtr<Gdk::Bitmap>& mask)
 See new_from_image() for details.
void set (const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask)
 See new_from_pixmap() for details.
void set_from_icon_name (const Glib::ustring& icon_name, IconSize size)
 See new_from_icon_name() for details.
void set_pixel_size (int pixel_size)
 Sets the pixel size to use for named icons.
virtual ~Image ()

Related Functions

(Note that these are not member functions.)

Gtk::Imagewrap (GtkImage* object, bool take_copy=false)
 
Parameters:
object The C instance


Constructor & Destructor Documentation

virtual Gtk::Image::~Image (  )  [virtual]

Gtk::Image::Image (  ) 

Gtk::Image::Image ( const Glib::RefPtr<Gdk::Pixmap>&  pixmap,
const Glib::RefPtr<Gdk::Bitmap>&  mask 
) [explicit]

Gtk::Image::Image ( const Glib::RefPtr<Gdk::Image>&  image,
const Glib::RefPtr<Gdk::Bitmap>&  mask 
) [explicit]

Gtk::Image::Image ( const std::string &  file  )  [explicit]

Gtk::Image::Image ( const Glib::RefPtr<Gdk::Pixbuf>&  pixbuf  )  [explicit]

Gtk::Image::Image ( const Gtk::StockID stock_id,
IconSize  size 
)

Gtk::Image::Image ( IconSet icon_set,
IconSize  size 
)

Gtk::Image::Image ( const Glib::RefPtr<Gdk::PixbufAnimation>&  animation  ) 


Member Function Documentation

void Gtk::Image::clear (  ) 

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.

Returns:
The displayed animation, or 0 if the image is 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.

Returns:
The displayed animation, or 0 if the image is empty.

Glib::ustring Gtk::Image::get_icon_name ( IconSize size  ) 

Glib::ustring Gtk::Image::get_icon_name (  )  const

void Gtk::Image::get_icon_set ( IconSet icon_set,
IconSize size 
) const

void Gtk::Image::get_image ( Glib::RefPtr<Gdk::Image>&  gdk_image,
Glib::RefPtr<Gdk::Bitmap>&  mask 
) const

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.

Returns:
The displayed pixbuf, or 0 if the image is empty.

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.

Returns:
The displayed pixbuf, or 0 if the image is empty.

int Gtk::Image::get_pixel_size (  )  const

Gets the pixel size used for named icons.

Returns:
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.

Returns:
Image representation being used.

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.

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).

Parameters:
animation The Gdk::PixbufAnimation.

void Gtk::Image::set ( IconSet icon_set,
IconSize  size 
)

See new_from_icon_set() for details.

Parameters:
icon_set A Gtk::IconSet.
size A stock icon size.

void Gtk::Image::set ( const Gtk::StockID stock_id,
IconSize  size 
)

See new_from_stock() for details.

Parameters:
stock_id A stock icon name.
size A stock icon size.

void Gtk::Image::set ( const Glib::RefPtr<Gdk::Pixbuf>&  pixbuf  ) 

See new_from_pixbuf() for details.

Parameters:
pixbuf A Gdk::Pixbuf or 0.

void Gtk::Image::set ( const std::string &  filename  ) 

See new_from_file() for details.

Parameters:
filename A filename or 0.

void Gtk::Image::set ( const Glib::RefPtr<Gdk::Image>&  gdk_image,
const Glib::RefPtr<Gdk::Bitmap>&  mask 
)

See new_from_image() for details.

Parameters:
gdk_image A Gdk::Image or 0.
mask A Gdk::Bitmap or 0.

void Gtk::Image::set ( const Glib::RefPtr<Gdk::Pixmap>&  pixmap,
const Glib::RefPtr<Gdk::Bitmap>&  mask 
)

See new_from_pixmap() for details.

Parameters:
pixmap A Gdk::Pixmap or 0.
mask A Gdk::Bitmap or 0.

void Gtk::Image::set_from_icon_name ( const Glib::ustring &  icon_name,
IconSize  size 
)

See new_from_icon_name() for details.

Parameters:
icon_name An icon name.
size An 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().

Parameters:
pixel_size The new pixel size.


Friends And Related Function Documentation

Gtk::Image* wrap ( GtkImage *  object,
bool  take_copy = false 
) [related]

Parameters:
object The C instance

Parameters:
take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.


The documentation for this class was generated from the following file:
Generated for gtkmm 2.4 by Doxygen 1.5.1 © 1997-2001