Next: , Previous: GtkCellRendererSpin, Up: Top


50 GtkCellRendererText

Renders text in a cell

50.1 Overview

A <gtk-cell-renderer-text> renders a given text in its cell, using the font, color and style information provided by its properties. The text will be ellipsized if it is too long and the ellipsize property allows it.

If the mode is ‘GTK_CELL_RENDERER_MODE_EDITABLE’, the <gtk-cell-renderer-text> allows to edit its text using an entry.

50.2 Usage

— Class: <gtk-cell-renderer-text>

Derives from <gtk-cell-renderer>.

This class defines the following slots:

text
Text to render
markup
Marked up text to render
attributes
A list of style attributes to apply to the text of the renderer
single-paragraph-mode
Whether or not to keep all text in a single paragraph
width-chars
The desired width of the label, in characters
wrap-width
The width at which the text is wrapped
alignment
How to align the lines
background
Background color as a string
foreground
Foreground color as a string
background-gdk
Background color as a GdkColor
foreground-gdk
Foreground color as a GdkColor
font
Font description as a string, e.g. "Sans Italic 12"
font-desc
Font description as a PangoFontDescription struct
family
Name of the font family, e.g. Sans, Helvetica, Times, Monospace
style
Font style
variant
Font variant
weight
Font weight
stretch
Font stretch
size
Font size
size-points
Font size in points
scale
Font scaling factor
editable
Whether the text can be modified by the user
strikethrough
Whether to strike through the text
underline
Style of underline for this text
rise
Offset of text above the baseline (below the baseline if rise is negative)
language
The language this text is in, as an ISO code. Pango can use this as a hint when rendering the text. If you don't understand this parameter, you probably don't need it
ellipsize
The preferred place to ellipsize the string, if the cell renderer does not have enough room to display the entire string
wrap-mode
How to break the string into multiple lines, if the cell renderer does not have enough room to display the entire string
background-set
Whether this tag affects the background color
foreground-set
Whether this tag affects the foreground color
family-set
Whether this tag affects the font family
style-set
Whether this tag affects the font style
variant-set
Whether this tag affects the font variant
weight-set
Whether this tag affects the font weight
stretch-set
Whether this tag affects the font stretch
size-set
Whether this tag affects the font size
scale-set
Whether this tag scales the font size by a factor
editable-set
Whether this tag affects text editability
strikethrough-set
Whether this tag affects strikethrough
underline-set
Whether this tag affects underlining
rise-set
Whether this tag affects the rise
language-set
Whether this tag affects the language the text is rendered as
ellipsize-set
Whether this tag affects the ellipsize mode
align-set
Whether this tag affects the alignment mode
— Signal on <gtk-cell-renderer-text>: edited (arg0 <gchararray>) (arg1 <gchararray>)

This signal is emitted after renderer has been edited.

— Function: gtk-cell-renderer-text-new ⇒  (ret <gtk-cell-renderer>)

Creates a new <gtk-cell-renderer-text>. Adjust how text is drawn using object properties. Object properties can be set globally (with g-object-set). Also, with <gtk-tree-view-column>, you can bind a property to a value in a <gtk-tree-model>. For example, you can bind the "text" property on the cell renderer to a string value in the model, thus rendering a different string in each row of the <gtk-tree-view>

ret
the new cell renderer