Gtk.CellRendererText¶
class — extends CellRenderer
:::warning Deprecated since 4.10 This API is deprecated. :::
Renders text in a cell
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 GtkCellRendererText:ellipsize property allows it.
If the GtkCellRenderer:mode is CellRendererMode.EDITABLE,
the GtkCellRendererText allows to edit its text using an entry.
Constructors¶
new¶
:::warning Deprecated since 4.10 This API is deprecated. :::
Creates a new GtkCellRendererText. Adjust how text is drawn using
object properties. Object properties can be
set globally (with g_object_set()). Also, with GtkTreeViewColumn,
you can bind a property to a value in a GtkTreeModel. 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 GtkTreeView.
Methods¶
set_fixed_height_from_font¶
:::warning Deprecated since 4.10 This API is deprecated. :::
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 inflexible, 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.
Parameters:
number_of_rows— Number of rows of text each cell renderer is allocated, or -1
Virtual methods¶
do_edited¶
Properties¶
align_set¶
alignment¶
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.
attributes¶
background¶
background_rgba¶
Background color as a GdkRGBA
background_set¶
editable¶
editable_set¶
ellipsize¶
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.EllipsizeMode.NONE turns off ellipsizing. See the wrap-width property
for another way of making the text fit into a given width.
ellipsize_set¶
family¶
family_set¶
font¶
font_desc¶
foreground¶
foreground_rgba¶
Foreground color as a GdkRGBA
foreground_set¶
language¶
language_set¶
markup¶
max_width_chars¶
The desired maximum width of the cell, in characters. If this property is set to -1, the width will be calculated automatically.
For cell renderers that ellipsize or wrap text; this property
controls the maximum reported width of the cell. The
cell should not receive any greater allocation unless it is
set to expand in its GtkCellLayout and all of the cell's siblings
have received their natural width.
placeholder_text¶
The text that will be displayed in the GtkCellRenderer if
GtkCellRendererText:editable is True and the cell is empty.
rise¶
rise_set¶
scale¶
scale_set¶
single_paragraph_mode¶
size¶
size_points¶
size_set¶
stretch¶
stretch_set¶
strikethrough¶
strikethrough_set¶
style¶
style_set¶
text¶
underline¶
underline_set¶
variant¶
variant_set¶
weight¶
weight_set¶
width_chars¶
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.
wrap_mode¶
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.
wrap_width¶
Specifies the minimum 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.
Signals¶
edited¶
This signal is emitted after renderer has been edited.
It is the responsibility of the application to update the model
and store new_text at the position indicated by path.