logo top
Main Page   Widgets   Namespaces   Book  

Gtk::IconSet Class Reference

List of all members.

Public Methods

 IconSet ()
 IconSet (GtkIconSet* castitem, bool make_a_copy=true)
 IconSet (const IconSet& src)
IconSet& operator= (const IconSet& src)
 ~IconSet ()
GtkIconSet* gobj ()
const GtkIconSet* gobj () const
GtkIconSet* gobj_copy () const
 IconSet (const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
IconSet copy () const
 Copies icon_set by value.

Glib::RefPtr<Gdk::Pixbufrender_icon (const Glib::RefPtr<Style>& style, TextDirection direction, StateType state, IconSize size, Widget& widget, const Glib::ustring& detail)
 Renders an icon using Gtk::Style::render_icon().

void add_source (const IconSource& source)
 Icon sets have a list of Gtk::IconSource, which they use as base icons for rendering icons in different states and sizes.

Glib::ArrayHandle<IconSizeget_sizes () const

Static Public Methods

IconSet lookup_default (const Gtk::StockID& stock_id)

Protected Attributes

GtkIconSet* gobject_

Related Functions

(Note that these are not member functions.)

Gtk::IconSet wrap (GtkIconSet* object, bool take_copy=false)

Constructor & Destructor Documentation

Gtk::IconSet::IconSet (  
 

Gtk::IconSet::IconSet ( GtkIconSet*    castitem,
bool    make_a_copy = true
[explicit]
 

Gtk::IconSet::IconSet ( const IconSet&    src
 

Gtk::IconSet::~IconSet (  
 

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


Member Function Documentation

void Gtk::IconSet::add_source ( const IconSource   source
 

Icon sets have a list of Gtk::IconSource, which they use as base icons for rendering icons in different states and sizes.

Icons are scaled, made to look insensitive, etc. in gtk_icon_set_render_icon(), but Gtk::IconSet needs base images to work with. The base images and when to use them are described by a Gtk::IconSource.

This function copies source, so you can reuse the same source immediately without affecting the icon set.

An example of when you'd use this function: a web browser's "Back to Previous Page" icon might point in a different direction in Hebrew and in English; it might look different when insensitive; and it might change size depending on toolbar mode (small/large icons). So a single icon set would contain all those variants of the icon, and you might add a separate source for each one.

You should nearly always add a "default" icon source with all fields wildcarded, which will be used as a fallback if no more specific source matches. Gtk::IconSet always prefers more specific icon sources to more generic icon sources. The order in which you add the sources to the icon set does not matter.

gtk_icon_set_new_from_pixbuf() creates a new icon set with a default icon source based on the given pixbuf.

Parameters:
source  A Gtk::IconSource.

IconSet Gtk::IconSet::copy (  
 

Copies icon_set by value.

Returns:
A new Gtk::IconSet identical to the first.

Glib::ArrayHandle<IconSize> Gtk::IconSet::get_sizes (  
 

const GtkIconSet* Gtk::IconSet::gobj (   const [inline]
 

GtkIconSet* Gtk::IconSet::gobj (   [inline]
 

GtkIconSet* Gtk::IconSet::gobj_copy (  
 

IconSet Gtk::IconSet::lookup_default ( const Gtk::StockID   stock_id [static]
 

IconSet& Gtk::IconSet::operator= ( const IconSet&    src
 

Glib::RefPtr<Gdk::Pixbuf> Gtk::IconSet::render_icon ( const Glib::RefPtr<Style>&    style,
TextDirection    direction,
StateType    state,
IconSize    size,
Widget   widget,
const Glib::ustring   detail
 

Renders an icon using Gtk::Style::render_icon().

In most cases, Gtk::Widget::render_icon() is better, since it automatically provides most of the arguments from the current widget settings. This function never returns 0; if the icon can't be rendered (perhaps because an image file fails to load), a default "missing image" icon will be returned instead.

Parameters:
style  A Gtk::Style associated with widget, or 0.
direction  Text direction.
state  Widget state.
size  Icon size.
widget  Widget that will display the icon, or 0.
detail  Detail to pass to the theme engine, or 0.
Returns:
A Gdk::Pixbuf to be displayed.


Friends And Related Function Documentation

Gtk::IconSet wrap ( GtkIconSet*    object,
bool    take_copy = false
[related]
 


Member Data Documentation

GtkIconSet* Gtk::IconSet::gobject_ [protected]
 


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