| GTK+ Reference Manual | ||||
|---|---|---|---|---|
#include <gtk/gtk.h>
GtkCellRendererText;
GtkCellRenderer* gtk_cell_renderer_text_new (void);
void gtk_cell_renderer_text_set_fixed_height_from_font
(GtkCellRendererText *renderer,
gint number_of_rows);
GObject +----GInitiallyUnowned +----GtkObject +----GtkCellRenderer +----GtkCellRendererText +----GtkCellRendererAccel +----GtkCellRendererCombo +----GtkCellRendererSpin
align-setgboolean : Read / Write alignmentPangoAlignment : Read / Write attributesPangoAttrList : Read / Write backgroundgchararray : Write background-gdkGdkColor : Read / Write background-setgboolean : Read / Write editablegboolean : Read / Write editable-setgboolean : Read / Write ellipsizePangoEllipsizeMode : Read / Write ellipsize-setgboolean : Read / Write familygchararray : Read / Write family-setgboolean : Read / Write fontgchararray : Read / Write font-descPangoFontDescription : Read / Write foregroundgchararray : Write foreground-gdkGdkColor : Read / Write foreground-setgboolean : Read / Write languagegchararray : Read / Write language-setgboolean : Read / Write markupgchararray : Write risegint : Read / Write rise-setgboolean : Read / Write scalegdouble : Read / Write scale-setgboolean : Read / Write single-paragraph-modegboolean : Read / Write sizegint : Read / Write size-pointsgdouble : Read / Write size-setgboolean : Read / Write stretchPangoStretch : Read / Write stretch-setgboolean : Read / Write strikethroughgboolean : Read / Write strikethrough-setgboolean : Read / Write stylePangoStyle : Read / Write style-setgboolean : Read / Write textgchararray : Read / Write underlinePangoUnderline : Read / Write underline-setgboolean : Read / Write variantPangoVariant : Read / Write variant-setgboolean : Read / Write weightgint : Read / Write weight-setgboolean : Read / Write width-charsgint : Read / Write wrap-modePangoWrapMode : Read / Write wrap-widthgint : Read / Write
A GtkCellRendererText 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 GtkCellRendererText allows to edit its text using an entry.
GtkCellRenderer* gtk_cell_renderer_text_new (void);
Creates a new GtkCellRendererText. Adjust how text is drawn using
object properties. Object properties can be
set globally (with g_object_set()
| Returns : | the new cell renderer |
void gtk_cell_renderer_text_set_fixed_height_from_font (GtkCellRendererText *renderer,gint number_of_rows);
Sets the height of a renderer to explicitly be determined by the "font" and
"y_pad" property set on it. Further changes in these properties do not
affect the height, so they must be accompanied by a subsequent call to this
function. Using this function is unflexible, and should really only be used
if calculating the size of a cell is too slow (ie, a massive number of cells
displayed). If number_of_rows is -1, then the fixed height is unset, and
the height is determined by the properties again.
renderer : |
A GtkCellRendererText |
number_of_rows : |
Number of rows of text each cell renderer is allocated, or -1 |
align-set propertyalign-setgboolean : Read / Write
Whether this tag affects the alignment mode.
Default value: FALSE
alignment propertyalignmentPangoAlignment : Read / Write
Specifies how to align the lines of text with respect to each other.
Note that this property describes how to align the lines of text in case there are several of them. The "xalign" property of GtkCellRenderer, on the other hand, sets the horizontal alignment of the whole text.
Default value: PANGO_ALIGN_LEFT
Since 2.10
attributes propertyattributesPangoAttrList : Read / Write
A list of style attributes to apply to the text of the renderer.
background propertybackgroundgchararray : Write
Background color as a string.
Default value: NULL
background-set propertybackground-setgboolean : Read / Write
Whether this tag affects the background color.
Default value: FALSE
editable propertyeditablegboolean : Read / Write
Whether the text can be modified by the user.
Default value: FALSE
editable-set propertyeditable-setgboolean : Read / Write
Whether this tag affects text editability.
Default value: FALSE
ellipsize propertyellipsizePangoEllipsizeMode : Read / Write
Specifies the preferred place to ellipsize the string, if the cell renderer
does not have enough room to display the entire string. Setting it to
PANGO_ELLIPSIZE_NONE
Default value: PANGO_ELLIPSIZE_NONE
Since 2.6
ellipsize-set propertyellipsize-setgboolean : Read / Write
Whether this tag affects the ellipsize mode.
Default value: FALSE
family propertyfamilygchararray : Read / Write
Name of the font family, e.g. Sans, Helvetica, Times, Monospace.
Default value: NULL
family-set propertyfamily-setgboolean : Read / Write
Whether this tag affects the font family.
Default value: FALSE
font propertyfontgchararray : Read / Write
Font description as a string, e.g. "Sans Italic 12".
Default value: NULL
font-desc propertyfont-descPangoFontDescription : Read / Write
Font description as a PangoFontDescription struct.
foreground propertyforegroundgchararray : Write
Foreground color as a string.
Default value: NULL
foreground-set propertyforeground-setgboolean : Read / Write
Whether this tag affects the foreground color.
Default value: FALSE
language propertylanguagegchararray : Read / Write
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.
Default value: NULL
language-set propertylanguage-setgboolean : Read / Write
Whether this tag affects the language the text is rendered as.
Default value: FALSE
rise propertyrisegint : Read / Write
Offset of text above the baseline (below the baseline if rise is negative).
Allowed values: >= -2147483647
Default value: 0
rise-set propertyrise-setgboolean : Read / Write
Whether this tag affects the rise.
Default value: FALSE
scale propertyscalegdouble : Read / Write
Font scaling factor.
Allowed values: >= 0
Default value: 1
scale-set propertyscale-setgboolean : Read / Write
Whether this tag scales the font size by a factor.
Default value: FALSE
single-paragraph-mode propertysingle-paragraph-modegboolean : Read / Write
Whether or not to keep all text in a single paragraph.
Default value: FALSE
size-points propertysize-pointsgdouble : Read / Write
Font size in points.
Allowed values: >= 0
Default value: 0
size-set propertysize-setgboolean : Read / Write
Whether this tag affects the font size.
Default value: FALSE
stretch propertystretchPangoStretch : Read / Write
Font stretch.
Default value: PANGO_STRETCH_NORMAL
stretch-set propertystretch-setgboolean : Read / Write
Whether this tag affects the font stretch.
Default value: FALSE
strikethrough propertystrikethroughgboolean : Read / Write
Whether to strike through the text.
Default value: FALSE
strikethrough-set propertystrikethrough-setgboolean : Read / Write
Whether this tag affects strikethrough.
Default value: FALSE
style-set propertystyle-setgboolean : Read / Write
Whether this tag affects the font style.
Default value: FALSE
underline propertyunderlinePangoUnderline : Read / Write
Style of underline for this text.
Default value: PANGO_UNDERLINE_NONE
underline-set propertyunderline-setgboolean : Read / Write
Whether this tag affects underlining.
Default value: FALSE
variant propertyvariantPangoVariant : Read / Write
Font variant.
Default value: PANGO_VARIANT_NORMAL
variant-set propertyvariant-setgboolean : Read / Write
Whether this tag affects the font variant.
Default value: FALSE
weight propertyweightgint : Read / Write
Font weight.
Allowed values: >= 0
Default value: 400
weight-set propertyweight-setgboolean : Read / Write
Whether this tag affects the font weight.
Default value: FALSE
width-chars propertywidth-charsgint : Read / Write
The desired width of the cell, in characters. If this property is set to -1, the width will be calculated automatically, otherwise the cell will request either 3 characters or the property value, whichever is greater.
Allowed values: >= -1
Default value: -1
Since 2.6
wrap-mode propertywrap-modePangoWrapMode : Read / Write
Specifies how to break the string into multiple lines, if the cell renderer does not have enough room to display the entire string. This property has no effect unless the wrap-width property is set.
Default value: PANGO_WRAP_CHAR
Since 2.8
wrap-width propertywrap-widthgint : Read / Write
Specifies the width at which the text is wrapped. The wrap-mode property can be used to influence at what character positions the line breaks can be placed. Setting wrap-width to -1 turns wrapping off.
Allowed values: >= -1
Default value: -1
Since 2.8
::edited signalvoid user_function (GtkCellRendererText *renderer,gchar *path,gchar *new_text,gpointer user_data) : Run Last
This signal is emitted after renderer has been edited.
renderer : |
the object which received the signal. |
path : |
the path identifying the edited cell. |
new_text : |
the new text. |
user_data : |
user data set when the signal handler was connected. |