| Gtk2Hs | Contents | Index

Graphics.UI.Gtk.TreeList.CellRenderer

Portability | portable (depends on GHC)
Stability | provisional
Maintainer | gtk2hs-users@lists.sourceforge.net

Contents

Detail
Class Hierarchy
Types
Methods

Description

A `CellRenderer` is an object that determines how the cell of a `TreeView` widget is displayed.

- Each `TreeViewColumn` has exactly one accociated `CellRenderer`. The data supply for a cell is contained in a `TreeStore` or a `ListStore` (both subclasses of `TreeModel`). Each `CellRenderer` may have several attributes. Each `Attribute` is associated with one column of the `TreeModel` database. Thus several columns of a `TreeModel` may be the supply for one `TreeViewColumn`.

Synopsis

data CellRenderer
class ObjectClass o => CellRendererClass o
castToCellRenderer :: GObjectClass obj => obj -> CellRenderer
toCellRenderer :: CellRendererClass o => o -> CellRenderer
data CellRendererClass cr => Attribute cr a = Attribute [String] [TMType] (a -> IO [GenericValue]) ([GenericValue] -> IO a)
cellRendererSet :: CellRendererClass cr => cr -> Attribute cr val -> val -> IO ()
cellRendererGet :: CellRendererClass cr => cr -> Attribute cr val -> IO val

Detail

The `CellRenderer` is a base class of a set of objects used for rendering a cell to a `Drawable`. These objects are used primarily by the `TreeView` widget, though they aren't tied to them in any specific way. It is worth noting that `CellRenderer` is not a `Widget` and cannot be treated as such.

The primary use of a `CellRenderer` is for drawing a certain graphical elements on a `Drawable`. 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 `GObject`s property system. Then, the cell is measured using cellRendererGetSize. Finally, the cell is rendered in the correct location using cellRendererRender.

Beyond merely rendering a cell, cell renderers can optionally provide active user interface elements. A cell renderer can be activatable like `CellRendererToggle`, which toggles when it gets activated by a mouse click, or it can be editable like `CellRendererText`, which allows the user to edit the text using a `Entry`.

Class Hierarchy

     |  GObject
     |   +----Object
     |         +----CellRenderer
     |               +----CellRendererText
     |               +----CellRendererPixbuf
     |               +----CellRendererProgress
     |               +----CellRendererToggle

Types
data CellRenderer

Instances

GObjectClass CellRenderer
CellRendererClass CellRenderer
ObjectClass CellRenderer

class ObjectClass o => CellRendererClass o

Instances

CellRendererClass CellRendererProgress
CellRendererClass CellRendererToggle
CellRendererClass CellRendererCombo
CellRendererClass CellRendererText
CellRendererClass CellRendererPixbuf
CellRendererClass CellRenderer

castToCellRenderer :: GObjectClass obj => obj -> CellRenderer
toCellRenderer :: CellRendererClass o => o -> CellRenderer
data CellRendererClass cr => Attribute cr a

Definition of the `Attribute` data type.

- Each `CellRenderer` defines a set of attributes. They are used by the Mogul layer to generate columns in a `TreeStore` or `ListStore`.

Constructors

Attribute [String] [TMType] (a -> IO [GenericValue]) ([GenericValue] -> IO a) |

Methods
cellRendererSet :: CellRendererClass cr => cr -> Attribute cr val -> val -> IO ()

Set a property statically.

- Instead of using a `TreeStore` or `ListStore` to set properties of a `CellRenderer` this method allows to set such a property for the whole column.

cellRendererGet :: CellRendererClass cr => cr -> Attribute cr val -> IO val

Get a static property.

- See `cellRendererSet`. Note that calling this function on a property of a `CellRenderer` object which retrieves its values from a `ListStore` or `TreeStore` will result in an abitrary value.

Produced by Haddock version 2.4.2