Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# Xfc::Gtk::CellView Class Reference

A GtkCellView C++ wrapper class. More...

`#include <xfc/gtk/cellview.hh>`

Inheritance diagram for Xfc::Gtk::CellView:

List of all members.

## Property Prototypes

- const BackgroundPropertyType background_property
    The background color as a string (see property_background()).
- const BackgroundGdkPropertyType background_gdk_property
    The background color as a (possibly unallocated) Gdk::Color (see property_background_gdk()).
- const BackgroundSetPropertyType background_set_property
    Whether this tag affects the background color (see property_background_set()).

## Public Member Functions

- const BackgroundPropertyProxy property_background ()
    The background color as a string (String : Write).
- const BackgroundGdkPropertyProxy property_background_gdk ()
    The background color as a (possibly unallocated) Gdk::Color (Pointer<Gdk::Color> : Read / Write).
- const BackgroundSetPropertyProxy property_background_set ()
    Whether this tag affects the background color (bool : Read / Write).

Constructors

- CellView ()
    Constructs a new cell view widget.
- CellView (const String &text, bool use_markup=false)
    Constructs a new cell view widget, adds a Gtk::CellRendererText to it, and makes its show text.
- CellView (Gdk::Pixbuf &pixbuf)
    Constructs a new cell view widget, adds a Gtk::CellRendererPixbuf to it, and makes its show pixbuf.
- virtual ~CellView ()
    Destructor.

Accessors

- GtkCellView * gtk_cell_view () const
    Get a pointer to the GtkCellView structure.
- operator GtkCellView * () const
    Conversion operator; safely converts an CellView to a GtkCellView pointer.
- Pointer< TreePath > get_displayed_row () const
    Obtains the path of the row currently displayed by the cell view, or null if the path pointed to is no longer valid.
- bool get_size_of_row (const TreePath &path, Requisition &requisition)
    Sets requisition to the size needed by the cell view to display the model row pointed to by path.
- bool get_cell_renderers (std::vector< CellRenderer * > &cell_list)
    Obtains a list of cell renderers which have been added to the cell view.

Methods

- void set_model (TreeModel *model)
    Sets the model for the cell view.
- void set_displayed_row (const TreePath *path)
    Sets the row of the model that is currently displayed by the cell view.
- void set_background_color (const Gdk::Color *color)
    Sets the background color of the cell view.

## Protected Member Functions

Constructors

- CellView (GtkCellView *cell_view, bool owns_reference=false)
    Construct a new CellView from an existing GtkCellView.

## Detailed Description

A GtkCellView C++ wrapper class.

A CellView displays a single row of a Gtk::TreeModel, using cell renderers just like Gtk::TreeView. CellView doesn't support some of the more complex features of Gtk::TreeView, like cell editing and drag and drop.

## Constructor & Destructor Documentation

Xfc::Gtk::CellView::CellView | ( | GtkCellView * | cell_view,
|  | bool | owns_reference = `false`
| ) | `[explicit, protected]`

Construct a new CellView from an existing GtkCellView.

Parameters:

  | cell_view | A pointer to a GtkCellView.
  | owns_reference | Set false if the initial reference count is floating, set true if it's not.

The cell_view can be a newly created GtkCellView or an existing GtkCellView. (see G::Object::Object).

Xfc::Gtk::CellView::CellView | ( | const String & | text,
|  | bool | use_markup = `false`
| ) |

Constructs a new cell view widget, adds a Gtk::CellRendererText to it, and makes its show text.

Parameters:

  | text | The text to display in the cell view.
  | use_markup | Set to true if text is marked up.

If use_markup is true, text can be text marked up with the Pango text markup language.

Xfc::Gtk::CellView::CellView | ( | Gdk::Pixbuf & | pixbuf | ) |

Constructs a new cell view widget, adds a Gtk::CellRendererPixbuf to it, and makes its show pixbuf.

Parameters:

  | pixbuf | The image to display in the cell view.

## Member Function Documentation

bool Xfc::Gtk::CellView::get_cell_renderers | ( | std::vector< CellRenderer * > & | cell_list | ) |

Obtains a list of cell renderers which have been added to the cell view.

Parameters:

  | cell_list | A reference to a vector of CellRenderer* to hold the list of cell renderers.

Returns:
  true if cell_list is not empty.

Pointer<TreePath> Xfc::Gtk::CellView::get_displayed_row | ( |  | ) | const

Obtains the path of the row currently displayed by the cell view, or null if the path pointed to is no longer valid.

Returns:
  The current path, or a null pointer.

bool Xfc::Gtk::CellView::get_size_of_row | ( | const TreePath & | path,
|  | Requisition & | requisition
| ) |

Sets requisition to the size needed by the cell view to display the model row pointed to by path.

Parameters:

  | path | A TreePath.
  | requisition | The return location for the size.

Returns:
  true

void Xfc::Gtk::CellView::set_background_color | ( | const Gdk::Color * | color | ) |

Sets the background color of the cell view.

Parameters:

  | color | The new background color, or null to unset the current color.

void Xfc::Gtk::CellView::set_displayed_row | ( | const TreePath * | path | ) |

Sets the row of the model that is currently displayed by the cell view.

Parameters:

  | path | A TreePath or null to unset the current path.

If the path is unset, then the contents of the cellview "stick" at their last value; this is not normally a desired result, but may be a needed intermediate state if say, the model for the cell view becomes temporarily empty.

void Xfc::Gtk::CellView::set_model | ( | TreeModel * | model | ) |

Sets the model for the cell view.

Parameters:

  | model | A TreeModel

If the cell view already has a model set, it will remove it before setting the new model. If model is null, then it will unset the old model.

The documentation for this class was generated from the following file:

- cellview.hh

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3