Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Inti::Gtk::CellRenderer Class Reference

A GtkCellRenderer C++ wrapper class. More...

#include <inti/gtk/cellrenderer.h>

Inheritance diagram for Inti::Gtk::CellRenderer:

Inti::Gtk::Object Inti::G::Object Inti::G::TypeInstance Inti::MemoryHandler Inti::ReferencedBase Inti::Gtk::CellRendererPixbuf Inti::Gtk::CellRendererText Inti::Gtk::CellRendererToggle List of all members.

Public Member Functions

Constructors
Accessors
Methods
Property Proxies

Protected Member Functions

Constructors

Detailed Description

A GtkCellRenderer C++ wrapper class.

The purpose of the cell renderers is to provide extensibility to the widget and to allow multiple ways of rendering the same type of data. For example, consider how to render a bool variable. Should you render it as a string of "true" or "false", "On" or "Off", or should you render it as a checkbox?

The TreeView widget uses columns and cell renderers to display a model. Cell renderers are used to draw the data in the tree model in a certain way. There are three cell renderers that come with Inti. They are the CellRendererText, CellRendererPixbuf and CellRendererToggle. It is relatively easy to write a custom renderer.


Constructor & Destructor Documentation

Inti::Gtk::CellRenderer::CellRenderer GtkCellRenderer *  cell,
bool  reference = false
[explicit, protected]
 

Construct a new CellRenderer from an existing GtkCellRenderer.

Parameters:
cell A pointer to a GtkCellRenderer.
reference Set false if the initial reference count is floating, set true if it's not.

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


Member Function Documentation

bool Inti::Gtk::CellRenderer::activate const Gdk::Event event,
Widget widget,
const String path,
const Gdk::Rectangle background_area,
const Gdk::Rectangle cell_area,
CellRendererStateField  flags
 

Passes an activate event to the cell renderer for possible processing.

Parameters:
event A Gdk::Event.
widget Widget that received the event.
path Widget-dependent string representation of the event location; e.g. for TreeView, a string representation of TreePath.
background_area Background area as passed to render.
cell_area Cell area as passed to render().
flags Render flags
Returns:
true if the event was handled.

Some cell renderers may use events; for example, CellRendererToggle toggles when it gets a mouse click.

void Inti::Gtk::CellRenderer::get_fixed_size int *  width,
int *  height
 

Fills in width and height with the appropriate size of cell.

Parameters:
width Location to fill in with the fixed width of the widget, or null.
height Location to fill in with the fixed height of the widget, or null.

void Inti::Gtk::CellRenderer::get_size const Widget widget,
const Gdk::Rectangle cell_area,
int *  x_offset,
int *  y_offset,
int *  width,
int *  height
const
 

Obtains the width and height needed to render the cell and sets the x and y offets (if set).

Parameters:
widget The widget the renderer is rendering to.
cell_area The area a cell will be allocated, or null
x_offset Location to return x offset of cell relative to cell_area, or null.
y_offset Location to return y offset of cell relative to cell_area, or null.
width Location to return width needed to render a cell, or null.
height Location to return height needed to render a cell, or null.

Used by view widgets to determine the appropriate size for the cell_area passed to render(). If cell_area is not null, fills in the x and y offsets (if set) of the cell relative to this location. Otherwise x_offset and y_offset are inorgred. Please note that the values set in width and height, as well as those in x_offset and y_offset are inclusive of the xpad and ypad properties.

void Inti::Gtk::CellRenderer::render Gdk::Window window,
Widget widget,
const Gdk::Rectangle background_area,
const Gdk::Rectangle cell_area,
const Gdk::Rectangle expose_area,
CellRendererStateField  flags
 

Invokes the virtual render function of the GtkCellRenderer.

Parameters:
window A GdkDrawable to draw to.
widget The widget owning window.
background_area Entire cell area (including tree expanders and maybe padding on the sides).
cell_area Area normally rendered by a cell renderer.
expose_area Area that actually needs updating.
flags Flags that affect the rendering.

The three passed-in rectangles are areas of window. Most renderers will draw within cell_area; the xalign, yalign, xpad, and ypad properties of the CellRenderer should be honored with respect to cell_area. The background_area includes the blank space around the cell, and also the area containing the tree expander; so the background_area rectangles for all cells tile to cover the entire window. The expose_area is a clip rectangle.

void Inti::Gtk::CellRenderer::set_fixed_size int  width,
int  height
 

Sets the renderer size to be explicit, independent of the properties set.

Parameters:
width The width of the cell renderer, or -1.
height The height of the cell renderer, or -1.

Pointer<CellEditable> Inti::Gtk::CellRenderer::start_editing const Gdk::Event event,
Widget widget,
const String path,
const Gdk::Rectangle background_area,
const Gdk::Rectangle cell_area,
CellRendererStateField  flags
 

Passes an activate event to the cell renderer for possible processing.

Parameters:
event A Gdk::Event.
widget Widget that received the event.
path Widget-dependent string representation of the event location; e.g. for TreeView, a string representation of TreePath.
background_area Background area as passed to render.
cell_area Cell area as passed to render().
flags Render flags
Returns:
A new CellEditable or null.


The documentation for this class was generated from the following file: Main Page - Footer


Generated on Sun Sep 14 20:08:13 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002