TextTag
-
class TextTag(**properties: Any)
Superclasses: 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 TextTagTable
for a given
GtkTextBuffer
before using them with that buffer.
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
-
class TextTag
-
classmethod new(name: str | None = None) → TextTag
Creates a GtkTextTag
.
- Parameters:
name – tag name
Methods
-
class TextTag
-
changed(size_changed: bool) → None
Emits the 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.
- Parameters:
size_changed – whether the change affects the GtkTextView
layout
-
get_priority() → int
Get the tag priority.
-
set_priority(priority: int) → None
Sets the priority of a GtkTextTag
.
Valid priorities start at 0 and go to one less than
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 create_tag
,
which adds the tag to the buffer’s table automatically.
- Parameters:
priority – the new priority
Properties
-
class TextTag
-
props.accumulative_margin: bool
The type of the None singleton.
-
props.allow_breaks: bool
The type of the None singleton.
-
props.allow_breaks_set: bool
The type of the None singleton.
-
props.background: str
The type of the None singleton.
-
props.background_full_height: bool
The type of the None singleton.
-
props.background_full_height_set: bool
The type of the None singleton.
-
props.background_rgba: RGBA
The type of the None singleton.
-
props.background_set: bool
The type of the None singleton.
-
props.direction: TextDirection
The type of the None singleton.
-
props.editable: bool
The type of the None singleton.
-
props.editable_set: bool
The type of the None singleton.
-
props.fallback: bool
The type of the None singleton.
-
props.fallback_set: bool
The type of the None singleton.
-
props.family: str
The type of the None singleton.
-
props.family_set: bool
The type of the None singleton.
-
props.font: str
The type of the None singleton.
-
props.font_desc: FontDescription
The type of the None singleton.
-
props.font_features: str
The type of the None singleton.
-
props.font_features_set: bool
The type of the None singleton.
-
props.foreground: str
The type of the None singleton.
-
props.foreground_rgba: RGBA
The type of the None singleton.
-
props.foreground_set: bool
The type of the None singleton.
-
props.indent: int
The type of the None singleton.
-
props.indent_set: bool
The type of the None singleton.
-
props.insert_hyphens: bool
The type of the None singleton.
-
props.insert_hyphens_set: bool
The type of the None singleton.
-
props.invisible: bool
The type of the None singleton.
-
props.invisible_set: bool
The type of the None singleton.
-
props.justification: Justification
The type of the None singleton.
-
props.justification_set: bool
The type of the None singleton.
-
props.language: str
The type of the None singleton.
-
props.language_set: bool
The type of the None singleton.
-
props.left_margin: int
The type of the None singleton.
-
props.left_margin_set: bool
The type of the None singleton.
-
props.letter_spacing: int
The type of the None singleton.
-
props.letter_spacing_set: bool
The type of the None singleton.
-
props.line_height: float
The type of the None singleton.
-
props.line_height_set: bool
The type of the None singleton.
-
props.name: str
The type of the None singleton.
-
props.overline: Overline
The type of the None singleton.
-
props.overline_rgba: RGBA
The type of the None singleton.
-
props.overline_rgba_set: bool
The type of the None singleton.
-
props.overline_set: bool
The type of the None singleton.
-
props.paragraph_background: str
The type of the None singleton.
-
props.paragraph_background_rgba: RGBA
The type of the None singleton.
-
props.paragraph_background_set: bool
The type of the None singleton.
-
props.pixels_above_lines: int
The type of the None singleton.
-
props.pixels_above_lines_set: bool
The type of the None singleton.
-
props.pixels_below_lines: int
The type of the None singleton.
-
props.pixels_below_lines_set: bool
The type of the None singleton.
-
props.pixels_inside_wrap: int
The type of the None singleton.
-
props.pixels_inside_wrap_set: bool
The type of the None singleton.
-
props.right_margin: int
The type of the None singleton.
-
props.right_margin_set: bool
The type of the None singleton.
-
props.rise: int
The type of the None singleton.
-
props.rise_set: bool
The type of the None singleton.
-
props.scale: float
The type of the None singleton.
-
props.scale_set: bool
The type of the None singleton.
-
props.sentence: bool
The type of the None singleton.
-
props.sentence_set: bool
The type of the None singleton.
-
props.show_spaces: ShowFlags
The type of the None singleton.
-
props.show_spaces_set: bool
The type of the None singleton.
-
props.size: int
The type of the None singleton.
-
props.size_points: float
The type of the None singleton.
-
props.size_set: bool
The type of the None singleton.
-
props.stretch: Stretch
The type of the None singleton.
-
props.stretch_set: bool
The type of the None singleton.
-
props.strikethrough: bool
The type of the None singleton.
-
props.strikethrough_rgba: RGBA
The type of the None singleton.
-
props.strikethrough_rgba_set: bool
The type of the None singleton.
-
props.strikethrough_set: bool
The type of the None singleton.
-
props.style: Style
The type of the None singleton.
-
props.style_set: bool
The type of the None singleton.
-
props.tabs: TabArray
The type of the None singleton.
-
props.tabs_set: bool
The type of the None singleton.
-
props.text_transform: TextTransform
The type of the None singleton.
-
props.text_transform_set: bool
The type of the None singleton.
-
props.underline: Underline
The type of the None singleton.
-
props.underline_rgba: RGBA
The type of the None singleton.
-
props.underline_rgba_set: bool
The type of the None singleton.
-
props.underline_set: bool
The type of the None singleton.
-
props.variant: Variant
The type of the None singleton.
-
props.variant_set: bool
The type of the None singleton.
-
props.weight: int
The type of the None singleton.
-
props.weight_set: bool
The type of the None singleton.
-
props.word: bool
The type of the None singleton.
-
props.word_set: bool
The type of the None singleton.
-
props.wrap_mode: WrapMode
The type of the None singleton.
-
props.wrap_mode_set: bool
The type of the None singleton.
Fields
-
class TextTag
-
parent_instance
-
priv