Gtk.CellRendererText¶
- Subclasses:
Gtk.CellRendererAccel
,Gtk.CellRendererCombo
,Gtk.CellRendererSpin
Methods¶
- Inherited:
- Structs:
class |
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Whether this tag affects the alignment mode |
||
r/w/en |
How to align the lines |
||
r/w |
A list of style attributes to apply to the text of the renderer |
||
w |
Background color as a string |
||
d/r/w |
Background color as a |
||
r/w |
Background color as a |
||
r/w |
Whether this tag affects the background color |
||
r/w |
Whether the text can be modified by the user |
||
r/w |
Whether this tag affects text editability |
||
r/w/en |
The preferred place to ellipsize the string, if the cell renderer does not have enough room to display the entire string |
||
r/w |
Whether this tag affects the ellipsize mode |
||
r/w |
Name of the font family, e.g. Sans, Helvetica, Times, Monospace |
||
r/w |
Whether this tag affects the font family |
||
r/w |
Font description as a string, e.g. “Sans Italic 12” |
||
r/w |
Font description as a |
||
w |
Foreground color as a string |
||
d/r/w |
Foreground color as a |
||
r/w |
Foreground color as a |
||
r/w |
Whether this tag affects the foreground color |
||
r/w |
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 |
||
r/w |
Whether this tag affects the language the text is rendered as |
||
w |
Marked up text to render |
||
r/w/en |
The maximum width of the cell, in characters |
||
r/w |
Text rendered when an editable cell is empty |
||
r/w |
Offset of text above the baseline (below the baseline if rise is negative) |
||
r/w |
Whether this tag affects the rise |
||
r/w |
Font scaling factor |
||
r/w |
Whether this tag scales the font size by a factor |
||
r/w/en |
Whether to keep all text in a single paragraph |
||
r/w |
Font size |
||
r/w |
Font size in points |
||
r/w |
Whether this tag affects the font size |
||
r/w |
Font stretch |
||
r/w |
Whether this tag affects the font stretch |
||
r/w |
Whether to strike through the text |
||
r/w |
Whether this tag affects strikethrough |
||
r/w |
Font style |
||
r/w |
Whether this tag affects the font style |
||
r/w |
Text to render |
||
r/w |
Style of underline for this text |
||
r/w |
Whether this tag affects underlining |
||
r/w |
Font variant |
||
r/w |
Whether this tag affects the font variant |
||
r/w |
Font weight |
||
r/w |
Whether this tag affects the font weight |
||
r/w/en |
The desired width of the label, in characters |
||
r/w/en |
How to break the string into multiple lines, if the cell renderer does not have enough room to display the entire string |
||
r/w/en |
The width at which the text is wrapped |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted after renderer has been edited. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Gtk.CellRendererText(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A
Gtk.CellRendererText
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 theGtk.CellRendererText
:ellipsize
property allows it.If the
Gtk.CellRenderer
:mode
isGtk.CellRendererMode.EDITABLE
, theGtk.CellRendererText
allows to edit its text using an entry.- classmethod new()[source]¶
- Returns:
the new cell renderer
- Return type:
Creates a new
Gtk.CellRendererText
. Adjust how text is drawn using object properties. Object properties can be set globally (with g_object_set()). Also, withGtk.TreeViewColumn
, you can bind a property to a value in aGtk.TreeModel
. 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 theGtk.TreeView
- set_fixed_height_from_font(number_of_rows)[source]¶
- Parameters:
number_of_rows (
int
) – Number of rows of text each cell renderer is allocated, or -1
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.
Signal Details¶
- Gtk.CellRendererText.signals.edited(cell_renderer_text, path, new_text)¶
- Signal Name:
edited
- Flags:
- Parameters:
cell_renderer_text (
Gtk.CellRendererText
) – The object which received the signalpath (
str
) – the path identifying the edited cellnew_text (
str
) – the new text
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.
Property Details¶
- Gtk.CellRendererText.props.align_set¶
-
Whether this tag affects the alignment mode
- Gtk.CellRendererText.props.alignment¶
- Name:
alignment
- Type:
- Default Value:
- Flags:
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
Gtk.CellRenderer
, on the other hand, sets the horizontal alignment of the whole text.New in version 2.10.
- Gtk.CellRendererText.props.attributes¶
- Name:
attributes
- Type:
- Default Value:
- Flags:
A list of style attributes to apply to the text of the renderer
- Gtk.CellRendererText.props.background¶
-
Background color as a string
- Gtk.CellRendererText.props.background_gdk¶
- Name:
background-gdk
- Type:
- Default Value:
- Flags:
Background color as a
Gdk.Color
Deprecated since version 3.4: Use
Gtk.CellRendererText
:background-rgba
instead.
- Gtk.CellRendererText.props.background_set¶
-
Whether this tag affects the background color
- Gtk.CellRendererText.props.editable¶
-
Whether the text can be modified by the user
- Gtk.CellRendererText.props.editable_set¶
-
Whether this tag affects text editability
- Gtk.CellRendererText.props.ellipsize¶
- Name:
ellipsize
- Type:
- Default Value:
- Flags:
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.New in version 2.6.
- Gtk.CellRendererText.props.ellipsize_set¶
-
Whether this tag affects the ellipsize mode
- Gtk.CellRendererText.props.family¶
-
Name of the font family, e.g. Sans, Helvetica, Times, Monospace
- Gtk.CellRendererText.props.family_set¶
-
Whether this tag affects the font family
- Gtk.CellRendererText.props.font¶
-
Font description as a string, e.g. “Sans Italic 12”
- Gtk.CellRendererText.props.font_desc¶
- Name:
font-desc
- Type:
- Default Value:
- Flags:
Font description as a
Pango.FontDescription
struct
- Gtk.CellRendererText.props.foreground¶
-
Foreground color as a string
- Gtk.CellRendererText.props.foreground_gdk¶
- Name:
foreground-gdk
- Type:
- Default Value:
- Flags:
Foreground color as a
Gdk.Color
Deprecated since version 3.4: Use
Gtk.CellRendererText
:foreground-rgba
instead.
- Gtk.CellRendererText.props.foreground_set¶
-
Whether this tag affects the foreground color
- Gtk.CellRendererText.props.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
- Gtk.CellRendererText.props.language_set¶
-
Whether this tag affects the language the text is rendered as
- Gtk.CellRendererText.props.markup¶
-
Marked up text to render
- Gtk.CellRendererText.props.max_width_chars¶
- Name:
max-width-chars
- Type:
- Default Value:
-1
- Flags:
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
Gtk.CellLayout
and all of the cell’s siblings have received their natural width.New in version 3.0.
- Gtk.CellRendererText.props.placeholder_text¶
-
The text that will be displayed in the
Gtk.CellRenderer
ifGtk.CellRendererText
:editable
isTrue
and the cell is empty.New in version 3.6.
- Gtk.CellRendererText.props.rise¶
-
Offset of text above the baseline (below the baseline if rise is negative)
- Gtk.CellRendererText.props.rise_set¶
-
Whether this tag affects the rise
- Gtk.CellRendererText.props.scale¶
-
Font scaling factor
- Gtk.CellRendererText.props.scale_set¶
-
Whether this tag scales the font size by a factor
- Gtk.CellRendererText.props.single_paragraph_mode¶
- Name:
single-paragraph-mode
- Type:
- Default Value:
- Flags:
Whether to keep all text in a single paragraph
- Gtk.CellRendererText.props.size¶
-
Font size
- Gtk.CellRendererText.props.size_points¶
-
Font size in points
- Gtk.CellRendererText.props.size_set¶
-
Whether this tag affects the font size
- Gtk.CellRendererText.props.stretch¶
- Name:
stretch
- Type:
- Default Value:
- Flags:
Font stretch
- Gtk.CellRendererText.props.stretch_set¶
-
Whether this tag affects the font stretch
- Gtk.CellRendererText.props.strikethrough¶
-
Whether to strike through the text
- Gtk.CellRendererText.props.strikethrough_set¶
-
Whether this tag affects strikethrough
- Gtk.CellRendererText.props.style¶
- Name:
style
- Type:
- Default Value:
- Flags:
Font style
- Gtk.CellRendererText.props.style_set¶
-
Whether this tag affects the font style
- Gtk.CellRendererText.props.text¶
-
Text to render
- Gtk.CellRendererText.props.underline¶
- Name:
underline
- Type:
- Default Value:
- Flags:
Style of underline for this text
- Gtk.CellRendererText.props.underline_set¶
-
Whether this tag affects underlining
- Gtk.CellRendererText.props.variant¶
- Name:
variant
- Type:
- Default Value:
- Flags:
Font variant
- Gtk.CellRendererText.props.variant_set¶
-
Whether this tag affects the font variant
- Gtk.CellRendererText.props.weight¶
-
Font weight
- Gtk.CellRendererText.props.weight_set¶
-
Whether this tag affects the font weight
- Gtk.CellRendererText.props.width_chars¶
- Name:
width-chars
- Type:
- Default Value:
-1
- Flags:
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.
New in version 2.6.
- Gtk.CellRendererText.props.wrap_mode¶
- Name:
wrap-mode
- Type:
- Default Value:
- Flags:
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.
New in version 2.8.
- Gtk.CellRendererText.props.wrap_width¶
- Name:
wrap-width
- Type:
- Default Value:
-1
- Flags:
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.
New in version 2.8.