Learn R Programming

RGtk2 (version 2.12.17)

GtkCellRenderer: GtkCellRenderer

Description

An object for rendering a single cell on a GdkDrawable

Arguments

Methods and Functions

gtkCellRendererGetSize(object, widget, cell.area = NULL) gtkCellRendererRender(object, window, widget, background.area, cell.area, expose.area, flags) gtkCellRendererActivate(object, event, widget, path, background.area, cell.area, flags) gtkCellRendererStartEditing(object, event, widget, path, background.area, cell.area, flags) gtkCellRendererEditingCanceled(object) gtkCellRendererEditingCanceled(object) gtkCellRendererStopEditing(object, canceled) gtkCellRendererGetFixedSize(object) gtkCellRendererSetFixedSize(object, width, height)

Hierarchy

GObject +----GInitiallyUnowned +----GtkObject +----GtkCellRenderer +----GtkCellRendererText +----GtkCellRendererPixbuf +----GtkCellRendererProgress +----GtkCellRendererToggle

Detailed Description

The GtkCellRenderer is a base class of a set of objects used for rendering a cell to a GdkDrawable. These objects are used primarily by the GtkTreeView widget, though they aren't tied to them in any specific way. It is worth noting that GtkCellRenderer is not a GtkWidget and cannot be treated as such. The primary use of a GtkCellRenderer is for drawing a certain graphical elements on a GdkDrawable. Typically, one cell renderer is used to draw many cells on the screen. To this extent, it isn't expected that a CellRenderer keep any permanent state around. Instead, any state is set just prior to use using GObjects property system. Then, the cell is measured using gtkCellRendererGetSize. Finally, the cell is rendered in the correct location using gtkCellRendererRender. There are a number of rules that must be followed when writing a new GtkCellRenderer. First and formost, it's important that a certain set of properties will always yield a cell renderer of the same size, barring a GtkStyle change. The GtkCellRenderer also has a number of generic properties that are expected to be honored by all children. Beyond merely rendering a cell, cell renderers can optionally provide active user interface elements. A cell renderer can be activatable like GtkCellRendererToggle, which toggles when it gets activated by a mouse click, or it can be editable like GtkCellRendererText, which allows the user to edit the text using a GtkEntry. To make a cell renderer activatable or editable, you have to implement the activate or start.editing virtual functions, respectively.

References

http://developer.gnome.org/doc/API/2.0/gtk/GtkCellRenderer.html

See Also

GtkCellRendererText GtkCellRendererPixbuf GtkCellRendererToggle