:right-sidebar: True TextTag =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: TextTag(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` A tag that can be applied to text contained in a ``GtkTextBuffer``\. You may wish to begin by reading the `text widget conceptual overview `__\, which gives an overview of all the objects and data types related to the text widget and how they work together. Tags should be in the :obj:`~gi.repository.Gtk.TextTagTable` for a given ``GtkTextBuffer`` before using them with that buffer. :obj:`~gi.repository.Gtk.TextBuffer.create_tag` is the best way to create tags. See “gtk4-demo” for numerous examples. For each property of ``GtkTextTag``\, there is a “set” property, e.g. “font-set” corresponds to “font”. These “set” properties reflect whether a property has been set or not. They are maintained by GTK and you should not set them independently. Constructors ------------ .. rst-class:: interim-class .. class:: TextTag :no-index: .. classmethod:: new(name: str | None = None) -> ~gi.repository.Gtk.TextTag Creates a ``GtkTextTag``\. :param name: tag name Methods ------- .. rst-class:: interim-class .. class:: TextTag :no-index: .. method:: changed(size_changed: bool) -> None Emits the :obj:`~gi.repository.Gtk.TextTagTable.signals.tag_changed` signal on the ``GtkTextTagTable`` where the tag is included. The signal is already emitted when setting a ``GtkTextTag`` property. This function is useful for a ``GtkTextTag`` subclass. :param size_changed: whether the change affects the ``GtkTextView`` layout .. method:: get_priority() -> int Get the tag priority. .. method:: set_priority(priority: int) -> None Sets the priority of a ``GtkTextTag``\. Valid priorities start at 0 and go to one less than :obj:`~gi.repository.Gtk.TextTagTable.get_size`\. Each tag in a table has a unique priority; setting the priority of one tag shifts the priorities of all the other tags in the table to maintain a unique priority for each tag. Higher priority tags “win” if two tags both set the same text attribute. When adding a tag to a tag table, it will be assigned the highest priority in the table by default; so normally the precedence of a set of tags is the order in which they were added to the table, or created with :obj:`~gi.repository.Gtk.TextBuffer.create_tag`\, which adds the tag to the buffer’s table automatically. :param priority: the new priority Properties ---------- .. rst-class:: interim-class .. class:: TextTag :no-index: .. attribute:: props.accumulative_margin :type: bool The type of the None singleton. .. attribute:: props.allow_breaks :type: bool The type of the None singleton. .. attribute:: props.allow_breaks_set :type: bool The type of the None singleton. .. attribute:: props.background :type: str The type of the None singleton. .. attribute:: props.background_full_height :type: bool The type of the None singleton. .. attribute:: props.background_full_height_set :type: bool 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.direction :type: ~gi.repository.Gtk.TextDirection 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.fallback :type: bool The type of the None singleton. .. attribute:: props.fallback_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.font_features :type: str The type of the None singleton. .. attribute:: props.font_features_set :type: bool 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.indent :type: int The type of the None singleton. .. attribute:: props.indent_set :type: bool The type of the None singleton. .. attribute:: props.insert_hyphens :type: bool The type of the None singleton. .. attribute:: props.insert_hyphens_set :type: bool The type of the None singleton. .. attribute:: props.invisible :type: bool The type of the None singleton. .. attribute:: props.invisible_set :type: bool The type of the None singleton. .. attribute:: props.justification :type: ~gi.repository.Gtk.Justification The type of the None singleton. .. attribute:: props.justification_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.left_margin :type: int The type of the None singleton. .. attribute:: props.left_margin_set :type: bool The type of the None singleton. .. attribute:: props.letter_spacing :type: int The type of the None singleton. .. attribute:: props.letter_spacing_set :type: bool The type of the None singleton. .. attribute:: props.line_height :type: float The type of the None singleton. .. versionadded:: 4.6 .. attribute:: props.line_height_set :type: bool The type of the None singleton. .. attribute:: props.name :type: str The type of the None singleton. .. attribute:: props.overline :type: ~gi.repository.Pango.Overline The type of the None singleton. .. attribute:: props.overline_rgba :type: ~gi.repository.Gdk.RGBA The type of the None singleton. .. attribute:: props.overline_rgba_set :type: bool The type of the None singleton. .. attribute:: props.overline_set :type: bool The type of the None singleton. .. attribute:: props.paragraph_background :type: str The type of the None singleton. .. attribute:: props.paragraph_background_rgba :type: ~gi.repository.Gdk.RGBA The type of the None singleton. .. attribute:: props.paragraph_background_set :type: bool The type of the None singleton. .. attribute:: props.pixels_above_lines :type: int The type of the None singleton. .. attribute:: props.pixels_above_lines_set :type: bool The type of the None singleton. .. attribute:: props.pixels_below_lines :type: int The type of the None singleton. .. attribute:: props.pixels_below_lines_set :type: bool The type of the None singleton. .. attribute:: props.pixels_inside_wrap :type: int The type of the None singleton. .. attribute:: props.pixels_inside_wrap_set :type: bool The type of the None singleton. .. attribute:: props.right_margin :type: int The type of the None singleton. .. attribute:: props.right_margin_set :type: bool 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.sentence :type: bool The type of the None singleton. .. versionadded:: 4.6 .. attribute:: props.sentence_set :type: bool The type of the None singleton. .. attribute:: props.show_spaces :type: ~gi.repository.Pango.ShowFlags The type of the None singleton. .. attribute:: props.show_spaces_set :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_rgba :type: ~gi.repository.Gdk.RGBA The type of the None singleton. .. attribute:: props.strikethrough_rgba_set :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.tabs :type: ~gi.repository.Pango.TabArray The type of the None singleton. .. attribute:: props.tabs_set :type: bool The type of the None singleton. .. attribute:: props.text_transform :type: ~gi.repository.Pango.TextTransform The type of the None singleton. .. versionadded:: 4.6 .. attribute:: props.text_transform_set :type: bool The type of the None singleton. .. attribute:: props.underline :type: ~gi.repository.Pango.Underline The type of the None singleton. .. attribute:: props.underline_rgba :type: ~gi.repository.Gdk.RGBA The type of the None singleton. .. attribute:: props.underline_rgba_set :type: bool 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.word :type: bool The type of the None singleton. .. versionadded:: 4.6 .. attribute:: props.word_set :type: bool The type of the None singleton. .. attribute:: props.wrap_mode :type: ~gi.repository.Gtk.WrapMode The type of the None singleton. .. attribute:: props.wrap_mode_set :type: bool The type of the None singleton. Fields ------ .. rst-class:: interim-class .. class:: TextTag :no-index: .. attribute:: parent_instance .. attribute:: priv