gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.ModelView.CellRenderer

Contents

- Detail
- Class Hierarchy
- Types
- Methods
- Attributes
- Signals
- Deprecated

Description

An object for rendering a cell in a list, icon or combo box widget.

Synopsis

- data CellRenderer
- class GObjectClass o => CellRendererClass o
- castToCellRenderer :: GObjectClass obj => obj -> CellRenderer
- gTypeCellRenderer :: GType
- toCellRenderer :: CellRendererClass o => o -> CellRenderer
- data CellRendererMode
  - = CellRendererModeInert
  - | CellRendererModeActivatable
  - | CellRendererModeEditable
- cellRendererStopEditing :: CellRendererClass self => self -> Bool -> IO ()
- cellRendererGetFixedSize :: CellRendererClass self => self -> IO (Int, Int)
- cellRendererSetFixedSize :: CellRendererClass self => self -> Int -> Int -> IO ()
- cellMode :: CellRendererClass self => Attr self CellRendererMode
- cellVisible :: CellRendererClass self => Attr self Bool
- cellSensitive :: CellRendererClass self => Attr self Bool
- cellXAlign :: CellRendererClass self => Attr self Float
- cellYAlign :: CellRendererClass self => Attr self Float
- cellXPad :: CellRendererClass self => Attr self Int
- cellYPad :: CellRendererClass self => Attr self Int
- cellWidth :: CellRendererClass self => Attr self Int
- cellHeight :: CellRendererClass self => Attr self Int
- cellIsExpander :: CellRendererClass self => Attr self Bool
- cellIsExpanded :: CellRendererClass self => Attr self Bool
- cellBackground :: (CellRendererClass self, GlibString string) => WriteAttr self string
- cellBackgroundSet :: CellRendererClass self => Attr self Bool
- editingStarted :: CellRendererClass self => Signal self (Widget -> TreePath -> IO ())
- editingCanceled :: CellRendererClass self => Signal self (IO ())

# 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 by changing the attributes of the cell. Then, the cell is measured and rendered in the correct location.

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
    | +----CellRendererCombo
    | +----CellRendererToggle

# Types

data CellRenderer Source #

#### Instances

Instances details

Eq CellRenderer Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: CellRenderer -> CellRenderer -> Bool Source # (/=) :: CellRenderer -> CellRenderer -> Bool Source #
Ord CellRenderer Source # |

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: CellRenderer -> CellRenderer -> Ordering Source #

(<) :: CellRenderer -> CellRenderer -> Bool Source #

(<=) :: CellRenderer -> CellRenderer -> Bool Source #

(>) :: CellRenderer -> CellRenderer -> Bool Source #

(>=) :: CellRenderer -> CellRenderer -> Bool Source #

max :: CellRenderer -> CellRenderer -> CellRenderer Source #

min :: CellRenderer -> CellRenderer -> CellRenderer Source #

GObjectClass CellRenderer Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: CellRenderer -> GObject Source # unsafeCastGObject :: GObject -> CellRenderer Source #
CellRendererClass CellRenderer Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class GObjectClass o => CellRendererClass o Source #

#### Instances

Instances details

CellRendererClass CellRenderer Source # |
Instance details Defined in Graphics.UI.Gtk.Types
CellRendererClass CellRendererAccel Source # |
Instance details Defined in Graphics.UI.Gtk.Types
CellRendererClass CellRendererCombo Source # |
Instance details Defined in Graphics.UI.Gtk.Types
CellRendererClass CellRendererPixbuf Source # |
Instance details Defined in Graphics.UI.Gtk.Types
CellRendererClass CellRendererProgress Source # |
Instance details Defined in Graphics.UI.Gtk.Types
CellRendererClass CellRendererSpin Source # |
Instance details Defined in Graphics.UI.Gtk.Types
CellRendererClass CellRendererSpinner Source # |
Instance details Defined in Graphics.UI.Gtk.Types
CellRendererClass CellRendererText Source # |
Instance details Defined in Graphics.UI.Gtk.Types
CellRendererClass CellRendererToggle Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToCellRenderer :: GObjectClass obj => obj -> CellRenderer Source #

gTypeCellRenderer :: GType Source #

toCellRenderer :: CellRendererClass o => o -> CellRenderer Source #

data CellRendererMode Source #

Constructors

CellRendererModeInert |
CellRendererModeActivatable |
CellRendererModeEditable |

#### Instances

Instances details

Enum CellRendererMode Source # |

Instance details

Defined in Graphics.UI.Gtk.ModelView.CellRenderer

Methods

succ :: CellRendererMode -> CellRendererMode Source #

pred :: CellRendererMode -> CellRendererMode Source #

toEnum :: Int -> CellRendererMode Source #

fromEnum :: CellRendererMode -> Int Source #

enumFrom :: CellRendererMode -> [CellRendererMode] Source #

enumFromThen :: CellRendererMode -> CellRendererMode -> [CellRendererMode] Source #

enumFromTo :: CellRendererMode -> CellRendererMode -> [CellRendererMode] Source #

enumFromThenTo :: CellRendererMode -> CellRendererMode -> CellRendererMode -> [CellRendererMode] Source #

Eq CellRendererMode Source # |
Instance details Defined in Graphics.UI.Gtk.ModelView.CellRenderer Methods (==) :: CellRendererMode -> CellRendererMode -> Bool Source # (/=) :: CellRendererMode -> CellRendererMode -> Bool Source #

# Methods

cellRendererStopEditing Source #

Arguments

:: CellRendererClass self |
=> self |
-> Bool | `canceled` - `True` if the editing has been canceled
-> IO () |

Informs the cell renderer that the editing is stopped. If `canceled` is `True`, the cell renderer will emit the `editingCanceled` signal.

- Available since Gtk+ version 2.6

cellRendererGetFixedSize Source #

Arguments

:: CellRendererClass self |
=> self |

-> IO (Int, Int)

    (width, height)

Returns `(width, height)` denoting the size of the fixed size of `cell`. If no fixed size is set, returns `-1` for that value.

cellRendererSetFixedSize Source #

Arguments

:: CellRendererClass self |
=> self |
-> Int | `width` - the width of the cell renderer, or -1
-> Int | `height` - the height of the cell renderer, or -1
-> IO () |

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

# Attributes

cellMode :: CellRendererClass self => Attr self CellRendererMode Source #

Editable mode of the CellRenderer.

Default value: `CellRendererModeInert`

cellVisible :: CellRendererClass self => Attr self Bool Source #

Display the cell.

Default value: `True`

cellSensitive :: CellRendererClass self => Attr self Bool Source #

Display the cell sensitive.

Default value: `True`

cellXAlign :: CellRendererClass self => Attr self Float Source #

The x-align.

Allowed values: `[0,1]`

Default value: `0.5`

cellYAlign :: CellRendererClass self => Attr self Float Source #

The y-align.

Allowed values: `[0,1]`

Default value: `0.5`

cellXPad :: CellRendererClass self => Attr self Int Source #

The xpad.

Default value: `0`

cellYPad :: CellRendererClass self => Attr self Int Source #

The ypad.

Default value: `0`

cellWidth :: CellRendererClass self => Attr self Int Source #

The fixed width.

Allowed values: `>= -1`

Default value: `-1`

cellHeight :: CellRendererClass self => Attr self Int Source #

The fixed height.

Allowed values: `>= -1`

Default value: `-1`

cellIsExpander :: CellRendererClass self => Attr self Bool Source #

Row has children.

Default value: `False`

cellIsExpanded :: CellRendererClass self => Attr self Bool Source #

Row is an expander row, and is expanded.

Default value: `False`

cellBackground :: (CellRendererClass self, GlibString string) => WriteAttr self string Source #

Cell background color as a string.

Default value: `""`

cellBackgroundSet :: CellRendererClass self => Attr self Bool Source #

Whether the `cellBackground` / `cellBackgroundColor` attribute is set.

You can use this to reset the attribute to its default.

Default value: `False`

# Signals

editingStarted :: CellRendererClass self => Signal self (Widget -> TreePath -> IO ()) Source #

This signal gets emitted when a cell starts to be edited. The intended use of this signal is to do special setup on `editable`, e.g. adding a `EntryCompletion` or setting up additional columns in a `ComboBox`.

- The widget that is passed to the handler contains the widget that is used by the `CellRenderer` to interact with the user. The widget must be casted to the appropriate widget. For instance, a `CellRendererText` uses an `Entry` widget, while a `CellRendererCombo` uses a `ComboBox` (if `cellComboHasEntry` is `False`) or a `ComboBoxEntry` (if `cellComboHasEntry` is `True`).
- Available since Gtk+ version 2.6

editingCanceled :: CellRendererClass self => Signal self (IO ()) Source #

This signal gets emitted when the user cancels the process of editing a cell. For example, an editable cell renderer could be written to cancel editing when the user presses Escape.

- Available since Gtk+ version 2.4

# Deprecated