:right-sidebar: True CellRendererText =================================================================== .. currentmodule:: gi.repository.Gtk .. deprecated:: 4.10 List views use widgets to display their contents. You should use :obj:`~gi.repository.Gtk.Inscription` or :obj:`~gi.repository.Gtk.Label` instead .. class:: CellRendererText(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.CellRenderer`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Subclasses: :class:`~gi.repository.Gtk.CellRendererAccel`, :class:`~gi.repository.Gtk.CellRendererCombo`, :class:`~gi.repository.Gtk.CellRendererSpin` 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 :const:`~gi.repository.Gtk.CellRendererMode.EDITABLE`, the ``GtkCellRendererText`` allows to edit its text using an entry. Constructors ------------ .. rst-class:: interim-class .. class:: CellRendererText :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.CellRenderer Creates a new ``GtkCellRendererText``\. Adjust how text is drawn using object properties. Object properties can be set globally (with :func:`~gi.repository.GObject.GObject.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``\. .. deprecated:: 4.10 Please do not use it in newly written code Methods ------- .. rst-class:: interim-class .. class:: CellRendererText :no-index: .. method:: do_edited(self, path: str, new_text: str) -> None :param path: :param new_text: .. method:: set_fixed_height_from_font(number_of_rows: int) -> None 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. .. deprecated:: 4.10 Please do not use it in newly written code :param number_of_rows: Number of rows of text each cell renderer is allocated, or -1 Properties ---------- .. rst-class:: interim-class .. class:: CellRendererText :no-index: .. attribute:: props.align_set :type: bool The type of the None singleton. .. attribute:: props.alignment :type: ~gi.repository.Pango.Alignment The type of the None singleton. .. attribute:: props.attributes :type: ~gi.repository.Pango.AttrList The type of the None singleton. .. attribute:: props.background :type: str The type of the None singleton. .. attribute:: props.background_rgba :type: ~gi.repository.Gdk.RGBA The type of the None singleton. .. attribute:: props.background_set :type: bool The type of the None singleton. .. attribute:: props.editable :type: bool The type of the None singleton. .. attribute:: props.editable_set :type: bool The type of the None singleton. .. attribute:: props.ellipsize :type: ~gi.repository.Pango.EllipsizeMode The type of the None singleton. .. attribute:: props.ellipsize_set :type: bool The type of the None singleton. .. attribute:: props.family :type: str The type of the None singleton. .. attribute:: props.family_set :type: bool The type of the None singleton. .. attribute:: props.font :type: str The type of the None singleton. .. attribute:: props.font_desc :type: ~gi.repository.Pango.FontDescription The type of the None singleton. .. attribute:: props.foreground :type: str The type of the None singleton. .. attribute:: props.foreground_rgba :type: ~gi.repository.Gdk.RGBA The type of the None singleton. .. attribute:: props.foreground_set :type: bool The type of the None singleton. .. attribute:: props.language :type: str The type of the None singleton. .. attribute:: props.language_set :type: bool The type of the None singleton. .. attribute:: props.markup :type: str The type of the None singleton. .. attribute:: props.max_width_chars :type: int The type of the None singleton. .. attribute:: props.placeholder_text :type: str The type of the None singleton. .. attribute:: props.rise :type: int The type of the None singleton. .. attribute:: props.rise_set :type: bool The type of the None singleton. .. attribute:: props.scale :type: float The type of the None singleton. .. attribute:: props.scale_set :type: bool The type of the None singleton. .. attribute:: props.single_paragraph_mode :type: bool The type of the None singleton. .. attribute:: props.size :type: int The type of the None singleton. .. attribute:: props.size_points :type: float The type of the None singleton. .. attribute:: props.size_set :type: bool The type of the None singleton. .. attribute:: props.stretch :type: ~gi.repository.Pango.Stretch The type of the None singleton. .. attribute:: props.stretch_set :type: bool The type of the None singleton. .. attribute:: props.strikethrough :type: bool The type of the None singleton. .. attribute:: props.strikethrough_set :type: bool The type of the None singleton. .. attribute:: props.style :type: ~gi.repository.Pango.Style The type of the None singleton. .. attribute:: props.style_set :type: bool The type of the None singleton. .. attribute:: props.text :type: str The type of the None singleton. .. attribute:: props.underline :type: ~gi.repository.Pango.Underline The type of the None singleton. .. attribute:: props.underline_set :type: bool The type of the None singleton. .. attribute:: props.variant :type: ~gi.repository.Pango.Variant The type of the None singleton. .. attribute:: props.variant_set :type: bool The type of the None singleton. .. attribute:: props.weight :type: int The type of the None singleton. .. attribute:: props.weight_set :type: bool The type of the None singleton. .. attribute:: props.width_chars :type: int The type of the None singleton. .. attribute:: props.wrap_mode :type: ~gi.repository.Pango.WrapMode The type of the None singleton. .. attribute:: props.wrap_width :type: int The type of the None singleton. Signals ------- .. rst-class:: interim-class .. class:: CellRendererText.signals :no-index: .. method:: edited(path: str, new_text: str) -> None The type of the None singleton. :param path: the path identifying the edited cell :param new_text: the new text Virtual Methods --------------- .. rst-class:: interim-class .. class:: CellRendererText :no-index: .. method:: do_edited(path: str, new_text: str) -> None The type of the None singleton. :param path: :param new_text: Fields ------ .. rst-class:: interim-class .. class:: CellRendererText :no-index: .. attribute:: parent