Gtk.TextTag¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Whether left and right margins accumulate. |
||
w |
Background color as a string |
||
r/w |
Whether the background color fills the entire line height or only the height of the tagged characters |
||
r/w |
Whether this tag affects background height |
||
d/r/w |
Background color as a |
||
r/w |
Background color as a |
||
r/w |
Whether this tag affects the background color |
||
r/w |
Text direction, e.g. right-to-left or left-to-right |
||
r/w |
Whether the text can be modified by the user |
||
r/w |
Whether this tag affects text editability |
||
r/w |
Whether font fallback is enabled. |
||
r/w |
Whether this tag affects font fallback |
||
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 |
||
r/w |
OpenType Font Features to use |
||
r/w |
Whether this tag affects font features |
||
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 |
Amount to indent the paragraph, in pixels |
||
r/w |
Whether this tag affects indentation |
||
r/w |
Whether this text is hidden. |
||
r/w |
Whether this tag affects text visibility |
||
r/w |
Left, right, or center justification |
||
r/w |
Whether this tag affects paragraph justification |
||
r/w |
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. |
||
r/w |
Whether this tag affects the language the text is rendered as |
||
r/w |
Width of the left margin in pixels |
||
r/w |
Whether this tag affects the left margin |
||
r/w |
Extra spacing between graphemes |
||
r/w |
Whether this tag affects letter spacing |
||
r/w/co |
Name used to refer to the text tag. |
||
w |
Paragraph background color as a string |
||
d/r/w |
Paragraph background color as a |
||
r/w |
Paragraph background RGBA as a |
||
r/w |
Whether this tag affects the paragraph background color |
||
r/w |
Pixels of blank space above paragraphs |
||
r/w |
Whether this tag affects the number of pixels above lines |
||
r/w |
Pixels of blank space below paragraphs |
||
r/w |
Whether this tag affects the number of pixels above lines |
||
r/w |
Pixels of blank space between wrapped lines in a paragraph |
||
r/w |
Whether this tag affects the number of pixels between wrapped lines |
||
r/w |
Width of the right margin in pixels |
||
r/w |
Whether this tag affects the right margin |
||
r/w |
Offset of text above the baseline (below the baseline if rise is negative) in Pango units |
||
r/w |
Whether this tag affects the rise |
||
r/w |
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 |
||
r/w |
Whether this tag scales the font size by a factor |
||
r/w |
Font size in Pango units |
||
r/w |
Font size in points |
||
r/w |
Whether this tag affects the font size |
||
r/w |
Font stretch as a |
||
r/w |
Whether this tag affects the font stretch |
||
r/w |
Whether to strike through the text |
||
r/w |
Color of strikethrough for this text |
||
r/w |
Whether this tag affects strikethrough color |
||
r/w |
Whether this tag affects strikethrough |
||
r/w |
Font style as a |
||
r/w |
Whether this tag affects the font style |
||
r/w |
Custom tabs for this text |
||
r/w |
Whether this tag affects tabs |
||
r/w |
Style of underline for this text |
||
r/w |
Color of underline for this text |
||
r/w |
Whether this tag affects underlining color |
||
r/w |
Whether this tag affects underlining |
||
r/w |
Font variant as a |
||
r/w |
Whether this tag affects the font variant |
||
r/w |
Font weight as an integer, see predefined values in |
||
r/w |
Whether this tag affects the font weight |
||
r/w |
Whether to wrap lines never, at word boundaries, or at character boundaries |
||
r/w |
Whether this tag affects line wrap mode |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
The |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gtk.TextTag(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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
Gtk.TextTagTable
for a givenGtk.TextBuffer
before using them with that buffer.Gtk.TextBuffer.create_tag
() is the best way to create tags. See “gtk3-demo” for numerous examples.For each property of
Gtk.TextTag
, 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
Gtk.TextTag
- Return type:
Creates a
Gtk.TextTag
. Configure the tag using object arguments, i.e. using g_object_set().
- changed(size_changed)[source]¶
- Parameters:
size_changed (
bool
) – whether the change affects theGtk.TextView
layout.
Emits the
Gtk.TextTagTable
::tag-changed
signal on theGtk.TextTagTable
where the tag is included.The signal is already emitted when setting a
Gtk.TextTag
property. This function is useful for aGtk.TextTag
subclass.New in version 3.20.
- event(event_object, event, iter)[source]¶
- Parameters:
event_object (
GObject.Object
) – object that received the event, such as a widgetevent (
Gdk.Event
) – the eventiter (
Gtk.TextIter
) – location where the event was received
- Returns:
result of signal emission (whether the event was handled)
- Return type:
Emits the “event” signal on the
Gtk.TextTag
.
- set_priority(priority)[source]¶
- Parameters:
priority (
int
) – the new priority
Sets the priority of a
Gtk.TextTag
. Valid priorities start at 0 and go to one less thanGtk.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 withGtk.TextBuffer.create_tag
(), which adds the tag to the buffer’s table automatically.
- do_event(event_object, event, iter) virtual¶
- Parameters:
event_object (
GObject.Object
) – object that received the event, such as a widgetevent (
Gdk.Event
) – the eventiter (
Gtk.TextIter
) – location where the event was received
- Returns:
result of signal emission (whether the event was handled)
- Return type:
Emits the “event” signal on the
Gtk.TextTag
.
Signal Details¶
- Gtk.TextTag.signals.event(text_tag, object, event, iter)¶
- Signal Name:
event
- Flags:
- Parameters:
text_tag (
Gtk.TextTag
) – The object which received the signalobject (
GObject.Object
) – the object the event was fired from (typically aGtk.TextView
)event (
Gdk.Event
) – the event which triggered the signaliter (
Gtk.TextIter
) – aGtk.TextIter
pointing at the location the event occurred
- Returns:
True
to stop other handlers from being invoked for the event.False
to propagate the event further.- Return type:
The
::event
signal is emitted when an event occurs on a region of the buffer marked with this tag.
Property Details¶
- Gtk.TextTag.props.accumulative_margin¶
-
Whether the margins accumulate or override each other.
When set to
True
the margins of this tag are added to the margins of any other non-accumulative margins present. When set toFalse
the margins override one another (the default).New in version 2.12.
- 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 this tag affects background height
- Gtk.TextTag.props.background_gdk¶
- Name:
background-gdk
- Type:
- Default Value:
- Flags:
Background color as a
Gdk.Color
.Deprecated since version 3.4: Use
Gtk.TextTag
:background-rgba
instead.
- Gtk.TextTag.props.background_set¶
-
Whether this tag affects the background color
- 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 this tag affects text editability
- 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.New in version 3.16.
- Gtk.TextTag.props.fallback_set¶
-
Whether this tag affects font fallback
- Gtk.TextTag.props.family¶
-
Name of the font family, e.g. Sans, Helvetica, Times, Monospace
- Gtk.TextTag.props.family_set¶
-
Whether this tag affects the font family
- 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
Pango.FontDescription
.
- Gtk.TextTag.props.font_desc¶
- Name:
font-desc
- Type:
- Default Value:
- Flags:
Font description as a
Pango.FontDescription
struct
- Gtk.TextTag.props.font_features¶
-
OpenType font features, as a string.
New in version 3.18.
- Gtk.TextTag.props.font_features_set¶
-
Whether this tag affects font features
- Gtk.TextTag.props.foreground¶
-
Foreground color as a string
- Gtk.TextTag.props.foreground_gdk¶
- Name:
foreground-gdk
- Type:
- Default Value:
- Flags:
Foreground color as a
Gdk.Color
.Deprecated since version 3.4: Use
Gtk.TextTag
:foreground-rgba
instead.
- Gtk.TextTag.props.foreground_set¶
-
Whether this tag affects the foreground color
- Gtk.TextTag.props.indent¶
-
Amount to indent the paragraph, in pixels
- Gtk.TextTag.props.indent_set¶
-
Whether this tag affects indentation
- 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.
New in version 2.8.
- Gtk.TextTag.props.invisible_set¶
-
Whether this tag affects text visibility
- Gtk.TextTag.props.justification¶
- Name:
justification
- Type:
- Default Value:
- Flags:
Left, right, or center justification
- Gtk.TextTag.props.justification_set¶
-
Whether this tag affects paragraph justification
- 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
Gtk.get_default_language
().
- Gtk.TextTag.props.language_set¶
-
Whether this tag affects the language the text is rendered as
- Gtk.TextTag.props.left_margin¶
-
Width of the left margin in pixels
- Gtk.TextTag.props.left_margin_set¶
-
Whether this tag affects the left margin
- Gtk.TextTag.props.letter_spacing¶
-
Extra spacing between graphemes, in Pango units.
New in version 3.16.
- Gtk.TextTag.props.letter_spacing_set¶
-
Whether this tag affects letter spacing
- Gtk.TextTag.props.name¶
- Name:
name
- Type:
- Default Value:
- Flags:
Name used to refer to the text tag.
None
for anonymous tags
- Gtk.TextTag.props.paragraph_background¶
-
The paragraph background color as a string.
New in version 2.8.
- Gtk.TextTag.props.paragraph_background_gdk¶
- Name:
paragraph-background-gdk
- Type:
- Default Value:
- Flags:
The paragraph background color as a
Gdk.Color
.New in version 2.8.
Deprecated since version 3.4: Use
Gtk.TextTag
:paragraph-background-rgba
instead.
- Gtk.TextTag.props.paragraph_background_rgba¶
-
The paragraph background color as a
Gdk.RGBA
.New in version 3.2.
- Gtk.TextTag.props.paragraph_background_set¶
-
Whether this tag affects the paragraph background color
- Gtk.TextTag.props.pixels_above_lines¶
-
Pixels of blank space above paragraphs
- Gtk.TextTag.props.pixels_above_lines_set¶
-
Whether this tag affects the number of pixels above lines
- Gtk.TextTag.props.pixels_below_lines¶
-
Pixels of blank space below paragraphs
- Gtk.TextTag.props.pixels_below_lines_set¶
-
Whether this tag affects the number of pixels above lines
- Gtk.TextTag.props.pixels_inside_wrap¶
-
Pixels of blank space between wrapped lines in a paragraph
- Gtk.TextTag.props.pixels_inside_wrap_set¶
-
Whether this tag affects the number of pixels between wrapped lines
- Gtk.TextTag.props.right_margin¶
-
Width of the right margin in pixels
- Gtk.TextTag.props.right_margin_set¶
-
Whether this tag affects the right margin
- Gtk.TextTag.props.rise¶
-
Offset of text above the baseline (below the baseline if rise is negative) in Pango units
- Gtk.TextTag.props.rise_set¶
-
Whether this tag affects the rise
- 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 this tag scales the font size by a factor
- Gtk.TextTag.props.size¶
-
Font size in Pango units
- Gtk.TextTag.props.size_points¶
-
Font size in points
- Gtk.TextTag.props.size_set¶
-
Whether this tag affects the font size
- Gtk.TextTag.props.stretch¶
- Name:
stretch
- Type:
- Default Value:
- Flags:
Font stretch as a
Pango.Stretch
, e.g.Pango.Stretch.CONDENSED
- Gtk.TextTag.props.stretch_set¶
-
Whether this tag affects the font stretch
- 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 forground color.
New in version 3.16.
- Gtk.TextTag.props.strikethrough_rgba_set¶
-
If the
Gtk.TextTag
:strikethrough-rgba
property has been set.New in version 3.16.
- Gtk.TextTag.props.strikethrough_set¶
-
Whether this tag affects strikethrough
- Gtk.TextTag.props.style¶
- Name:
style
- Type:
- Default Value:
- Flags:
Font style as a
Pango.Style
, e.g.Pango.Style.ITALIC
- Gtk.TextTag.props.style_set¶
-
Whether this tag affects the font style
- Gtk.TextTag.props.tabs¶
- Name:
tabs
- Type:
- Default Value:
- Flags:
Custom tabs for this text
- Gtk.TextTag.props.tabs_set¶
-
Whether this tag affects tabs
- 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 forground color.
If
Gtk.TextTag
:underline
is set toPango.Underline.ERROR
, an alternate color may be applied instead of the foreground. Setting this property will always override those defaults.New in version 3.16.
- Gtk.TextTag.props.underline_rgba_set¶
-
If the
Gtk.TextTag
:underline-rgba
property has been set.New in version 3.16.
- Gtk.TextTag.props.underline_set¶
-
Whether this tag affects underlining
- Gtk.TextTag.props.variant¶
- Name:
variant
- Type:
- Default Value:
- Flags:
Font variant as a
Pango.Variant
, e.g.Pango.Variant.SMALL_CAPS
- Gtk.TextTag.props.variant_set¶
-
Whether this tag affects the font variant
- Gtk.TextTag.props.weight¶
-
Font weight as an integer, see predefined values in
Pango.Weight
; for example,Pango.Weight.BOLD
- Gtk.TextTag.props.weight_set¶
-
Whether this tag affects the font weight
- Gtk.TextTag.props.wrap_mode¶
- Name:
wrap-mode
- Type:
- Default Value:
- Flags:
Whether to wrap lines never, at word boundaries, or at character boundaries