Gtk.TextTag¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
|||
r/w |
|||
r/w |
|||
w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w/co |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gtk.TextTag(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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 [class`Gtk`.TextTagTable] for a given
GtkTextBufferbefore using them with that buffer.[method`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.
- classmethod new(name)[source]¶
- Parameters:
- Returns:
a new
GtkTextTag- Return type:
Creates a
GtkTextTag.
- changed(size_changed)[source]¶
- Parameters:
size_changed (
bool) – whether the change affects theGtkTextViewlayout
Emits the [signal`Gtk`.TextTagTable::tag-changed] signal on the
GtkTextTagTablewhere the tag is included.The signal is already emitted when setting a
GtkTextTagproperty. This function is useful for aGtkTextTagsubclass.
- set_priority(priority)[source]¶
- Parameters:
priority (
int) – the new priority
Sets the priority of a
GtkTextTag.Valid priorities start at 0 and go to one less than [method`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 [method`Gtk`.TextBuffer.create_tag], which adds the tag to the buffer’s table automatically.
Property Details¶
- Gtk.TextTag.props.accumulative_margin¶
-
Whether the margins accumulate or override each other.
When set to
Truethe margins of this tag are added to the margins of any other non-accumulative margins present. When set toFalsethe margins override one another (the default).
- Gtk.TextTag.props.allow_breaks¶
-
Whether breaks are allowed.
- Gtk.TextTag.props.allow_breaks_set¶
-
Whether the
allow-breaksproperty is set.
- Gtk.TextTag.props.background¶
-
Background color as a string.
- Gtk.TextTag.props.background_full_height¶
-
Whether the background color fills the entire line height or only the height of the tagged characters.
- Gtk.TextTag.props.background_full_height_set¶
-
Whether the
background-full-heightproperty is set.
- Gtk.TextTag.props.background_rgba¶
-
Background color as a
GdkRGBA.
- Gtk.TextTag.props.background_set¶
-
Whether the
backgroundproperty is set.
- Gtk.TextTag.props.direction¶
- Name:
direction- Type:
- Default Value:
- Flags:
Text direction, e.g. right-to-left or left-to-right.
- Gtk.TextTag.props.editable¶
-
Whether the text can be modified by the user.
- Gtk.TextTag.props.editable_set¶
-
Whether the
editableproperty is set.
- Gtk.TextTag.props.fallback¶
-
Whether font fallback is enabled.
When set to
True, other fonts will be substituted where the current font is missing glyphs.
- Gtk.TextTag.props.fallback_set¶
-
Whether the
fallbackproperty is set.
- Gtk.TextTag.props.family¶
-
Name of the font family, e.g. Sans, Helvetica, Times, Monospace.
- Gtk.TextTag.props.family_set¶
-
Whether the
familyproperty is set.
- Gtk.TextTag.props.font¶
-
Font description as string, e.g. \”Sans Italic 12\”.
Note that the initial value of this property depends on the internals of
PangoFontDescription.
- Gtk.TextTag.props.font_desc¶
- Name:
font-desc- Type:
- Default Value:
- Flags:
Font description as a
PangoFontDescription.
- Gtk.TextTag.props.font_features¶
-
OpenType font features, as a string.
- Gtk.TextTag.props.font_features_set¶
-
Whether the
font-featuresproperty is set.
- Gtk.TextTag.props.foreground¶
-
Foreground color as a string.
- Gtk.TextTag.props.foreground_rgba¶
-
Foreground color as a
GdkRGBA.
- Gtk.TextTag.props.foreground_set¶
-
Whether the
foregroundproperty is set.
- Gtk.TextTag.props.indent¶
-
Amount to indent the paragraph, in pixels.
A negative value of indent will produce a hanging indentation. That is, the first line will have the full width, and subsequent lines will be indented by the absolute value of indent.
- Gtk.TextTag.props.indent_set¶
-
Whether the
indentproperty is set.
- Gtk.TextTag.props.insert_hyphens¶
-
Whether to insert hyphens at breaks.
- Gtk.TextTag.props.insert_hyphens_set¶
-
Whether the
insert-hyphensproperty is set.
- Gtk.TextTag.props.invisible¶
-
Whether this text is hidden.
Note that there may still be problems with the support for invisible text, in particular when navigating programmatically inside a buffer containing invisible segments.
- Gtk.TextTag.props.invisible_set¶
-
Whether the
invisibleproperty is set.
- Gtk.TextTag.props.justification¶
- Name:
justification- Type:
- Default Value:
- Flags:
Left, right, or center justification.
- Gtk.TextTag.props.justification_set¶
-
Whether the
justificationproperty is set.
- Gtk.TextTag.props.language¶
-
The language this text is in, as an ISO code.
Pango can use this as a hint when rendering the text. If not set, an appropriate default will be used.
Note that the initial value of this property depends on the current locale, see also [func`Gtk`.get_default_language].
- Gtk.TextTag.props.language_set¶
-
Whether the
languageproperty is set.
- Gtk.TextTag.props.left_margin¶
-
Width of the left margin in pixels.
- Gtk.TextTag.props.left_margin_set¶
-
Whether the
left-marginproperty is set.
- Gtk.TextTag.props.letter_spacing¶
-
Extra spacing between graphemes, in Pango units.
- Gtk.TextTag.props.letter_spacing_set¶
-
Whether the
letter-spacingproperty is set.
- Gtk.TextTag.props.line_height¶
-
Factor to scale line height by.
New in version 4.6.
- Gtk.TextTag.props.line_height_set¶
-
Whether the
line-heightproperty is set.
- Gtk.TextTag.props.name¶
- Name:
name- Type:
- Default Value:
- Flags:
The name used to refer to the tag.
Nonefor anonymous tags.
- Gtk.TextTag.props.overline¶
- Name:
overline- Type:
- Default Value:
- Flags:
Style of overline for this text.
- Gtk.TextTag.props.overline_rgba¶
-
This property modifies the color of overlines.
If not set, overlines will use the foreground color.
- Gtk.TextTag.props.overline_rgba_set¶
-
Whether the
overline-rgbaproperty is set.
- Gtk.TextTag.props.overline_set¶
-
Whether the
overlineproperty is set.
- Gtk.TextTag.props.paragraph_background¶
-
The paragraph background color as a string.
- Gtk.TextTag.props.paragraph_background_rgba¶
-
The paragraph background color as a
GdkRGBA.
- Gtk.TextTag.props.paragraph_background_set¶
-
Whether the
paragraph-backgroundproperty is set.
- Gtk.TextTag.props.pixels_above_lines¶
-
Pixels of blank space above paragraphs.
- Gtk.TextTag.props.pixels_above_lines_set¶
-
Whether the
pixels-above-linesproperty is set.
- Gtk.TextTag.props.pixels_below_lines¶
-
Pixels of blank space below paragraphs.
- Gtk.TextTag.props.pixels_below_lines_set¶
-
Whether the
pixels-below-linesproperty is set.
- Gtk.TextTag.props.pixels_inside_wrap¶
-
Pixels of blank space between wrapped lines in a paragraph.
- Gtk.TextTag.props.pixels_inside_wrap_set¶
-
Whether the
pixels-inside-wrapproperty is set.
- Gtk.TextTag.props.right_margin¶
-
Width of the right margin, in pixels.
- Gtk.TextTag.props.right_margin_set¶
-
Whether the
right-marginproperty is set.
- Gtk.TextTag.props.rise¶
-
Offset of text above the baseline, in Pango units.
Negative values go below the baseline.
- Gtk.TextTag.props.rise_set¶
-
Whether the
riseproperty is set.
- Gtk.TextTag.props.scale¶
-
Font size as a scale factor relative to the default font size.
This properly adapts to theme changes, etc. so is recommended. Pango predefines some scales such as %PANGO_SCALE_X_LARGE.
- Gtk.TextTag.props.scale_set¶
-
Whether the
scaleproperty is set.
- Gtk.TextTag.props.sentence¶
-
Whether this tag represents a single sentence.
This affects cursor movement.
New in version 4.6.
- Gtk.TextTag.props.sentence_set¶
-
Whether the
sentenceproperty is set.
- Gtk.TextTag.props.show_spaces¶
- Name:
show-spaces- Type:
- Default Value:
- Flags:
How to render invisible characters.
- Gtk.TextTag.props.show_spaces_set¶
-
Whether the
show-spacesproperty is set.
- Gtk.TextTag.props.size¶
-
Font size in Pango units.
- Gtk.TextTag.props.size_points¶
-
Font size in points.
- Gtk.TextTag.props.size_set¶
-
Whether the
sizeproperty is set.
- Gtk.TextTag.props.stretch¶
- Name:
stretch- Type:
- Default Value:
- Flags:
Font stretch as a
PangoStretch, e.g.Pango.Stretch.CONDENSED.
- Gtk.TextTag.props.stretch_set¶
-
Whether the
stretchproperty is set.
- Gtk.TextTag.props.strikethrough¶
-
Whether to strike through the text.
- Gtk.TextTag.props.strikethrough_rgba¶
-
This property modifies the color of strikeouts.
If not set, strikeouts will use the foreground color.
- Gtk.TextTag.props.strikethrough_rgba_set¶
-
If the
strikethrough-rgbaproperty has been set.
- Gtk.TextTag.props.strikethrough_set¶
-
Whether the
strikethroughproperty is set.
- Gtk.TextTag.props.style¶
- Name:
style- Type:
- Default Value:
- Flags:
Font style as a
PangoStyle, e.g.Pango.Style.ITALIC.
- Gtk.TextTag.props.style_set¶
-
Whether the
styleproperty is set.
- Gtk.TextTag.props.tabs¶
- Name:
tabs- Type:
- Default Value:
- Flags:
Custom tabs for this text.
- Gtk.TextTag.props.tabs_set¶
-
Whether the
tabsproperty is set.
- Gtk.TextTag.props.text_transform¶
- Name:
text-transform- Type:
- Default Value:
- Flags:
How to transform the text for display.
New in version 4.6.
- Gtk.TextTag.props.text_transform_set¶
-
Whether the
text-transformproperty is set.
- Gtk.TextTag.props.underline¶
- Name:
underline- Type:
- Default Value:
- Flags:
Style of underline for this text.
- Gtk.TextTag.props.underline_rgba¶
-
This property modifies the color of underlines.
If not set, underlines will use the foreground color.
If [property`Gtk`.TextTag:underline] is set to
Pango.Underline.ERROR, an alternate color may be applied instead of the foreground. Setting this property will always override those defaults.
- Gtk.TextTag.props.underline_rgba_set¶
-
If the
underline-rgbaproperty has been set.
- Gtk.TextTag.props.underline_set¶
-
Whether the
underlineproperty is set.
- Gtk.TextTag.props.variant¶
- Name:
variant- Type:
- Default Value:
- Flags:
Font variant as a
PangoVariant, e.g.Pango.Variant.SMALL_CAPS.
- Gtk.TextTag.props.variant_set¶
-
Whether the
variantproperty is set.
- Gtk.TextTag.props.weight¶
-
Font weight as an integer.
- Gtk.TextTag.props.weight_set¶
-
Whether the
weightproperty is set.
- Gtk.TextTag.props.word¶
-
Whether this tag represents a single word.
This affects line breaks and cursor movement.
New in version 4.6.
- Gtk.TextTag.props.word_set¶
-
Whether the
wordproperty is set.
- Gtk.TextTag.props.wrap_mode¶
- Name:
wrap-mode- Type:
- Default Value:
- Flags:
Whether to wrap lines never, at word boundaries, or at character boundaries.