gtk.text_tag
Module for [TextTag] class
Types 3
classTextTag : gobject.object.ObjectWrap
A tag that can be applied to text contained in a [gtk.text_buffer.TextBuffer].
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.text_tag_table.TextTagTable] for a given [gtk.text_buffer.TextBuffer] before using them with that buffer.
[gtk.text_buffer.TextBuffer.createTag] is the best way to create tags. See “gtk4-demo” for numerous examples.
For each property of [gtk.text_tag.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.
Methods
TextTagGidBuilder builder()Get builder for [gtk.text_tag.TextTag] Returns: New builder objectbool accumulativeMargin() @propertyGet `accumulativeMargin` property. Returns: Whether the margins accumulate or override each other.void accumulativeMargin(bool propval) @propertySet `accumulativeMargin` property. Params: propval = Whether the margins accumulate or override each other.void allowBreaks(bool propval) @propertySet `allowBreaks` property. Params: propval = Whether breaks are allowed.bool allowBreaksSet() @propertyvoid allowBreaksSet(bool propval) @propertyvoid background(string propval) @propertySet `background` property. Params: propval = Background color as a string.bool backgroundFullHeight() @propertyGet `backgroundFullHeight` property. Returns: Whether the background color fills the entire line height or only the height of the tagged characters.void backgroundFullHeight(bool propval) @propertySet `backgroundFullHeight` property. Params: propval = Whether the background color fills the entire line height or only the height of the tagged characters.bool backgroundFullHeightSet() @propertyvoid backgroundFullHeightSet(bool propval) @propertygdk.rgba.RGBA backgroundRgba() @propertyGet `backgroundRgba` property. Returns: Background color as a [gdk.rgba.RGBA].void backgroundRgba(gdk.rgba.RGBA propval) @propertySet `backgroundRgba` property. Params: propval = Background color as a [gdk.rgba.RGBA].bool backgroundSet() @propertyvoid backgroundSet(bool propval) @propertygtk.types.TextDirection direction() @propertyGet `direction` property. Returns: Text direction, e.g. right-to-left or left-to-right.void direction(gtk.types.TextDirection propval) @propertySet `direction` property. Params: propval = Text direction, e.g. right-to-left or left-to-right.bool editable() @propertyGet `editable` property. Returns: Whether the text can be modified by the user.void editable(bool propval) @propertySet `editable` property. Params: propval = Whether the text can be modified by the user.bool editableSet() @propertyvoid editableSet(bool propval) @propertyvoid fallback(bool propval) @propertySet `fallback` property. Params: propval = Whether font fallback is enabled.bool fallbackSet() @propertyvoid fallbackSet(bool propval) @propertystring family() @propertyGet `family` property. Returns: Name of the font family, e.g. Sans, Helvetica, Times, Monospace.void family(string propval) @propertySet `family` property. Params: propval = Name of the font family, e.g. Sans, Helvetica, Times, Monospace.bool familySet() @propertyvoid familySet(bool propval) @propertystring font() @propertyGet `font` property. Returns: Font description as string, e.g. \"Sans Italic 12\".void font(string propval) @propertySet `font` property. Params: propval = Font description as string, e.g. \"Sans Italic 12\".pango.font_description.FontDescription fontDesc() @propertyGet `fontDesc` property. Returns: Font description as a [pango.font_description.FontDescription].void fontDesc(pango.font_description.FontDescription propval) @propertySet `fontDesc` property. Params: propval = Font description as a [pango.font_description.FontDescription].string fontFeatures() @propertyGet `fontFeatures` property. Returns: OpenType font features, as a string.void fontFeatures(string propval) @propertySet `fontFeatures` property. Params: propval = OpenType font features, as a string.bool fontFeaturesSet() @propertyvoid fontFeaturesSet(bool propval) @propertyvoid foreground(string propval) @propertySet `foreground` property. Params: propval = Foreground color as a string.gdk.rgba.RGBA foregroundRgba() @propertyGet `foregroundRgba` property. Returns: Foreground color as a [gdk.rgba.RGBA].void foregroundRgba(gdk.rgba.RGBA propval) @propertySet `foregroundRgba` property. Params: propval = Foreground color as a [gdk.rgba.RGBA].bool foregroundSet() @propertyvoid foregroundSet(bool propval) @propertyvoid indent(int propval) @propertySet `indent` property. Params: propval = Amount to indent the paragraph, in pixels.bool indentSet() @propertyvoid indentSet(bool propval) @propertybool insertHyphens() @propertyGet `insertHyphens` property. Returns: Whether to insert hyphens at breaks.void insertHyphens(bool propval) @propertySet `insertHyphens` property. Params: propval = Whether to insert hyphens at breaks.bool insertHyphensSet() @propertyvoid insertHyphensSet(bool propval) @propertyvoid invisible(bool propval) @propertySet `invisible` property. Params: propval = Whether this text is hidden.bool invisibleSet() @propertyvoid invisibleSet(bool propval) @propertygtk.types.Justification justification() @propertyGet `justification` property. Returns: Left, right, or center justification.void justification(gtk.types.Justification propval) @propertySet `justification` property. Params: propval = Left, right, or center justification.bool justificationSet() @propertyvoid justificationSet(bool propval) @propertystring language() @propertyGet `language` property. Returns: The language this text is in, as an ISO code.void language(string propval) @propertySet `language` property. Params: propval = The language this text is in, as an ISO code.bool languageSet() @propertyvoid languageSet(bool propval) @propertyvoid leftMargin(int propval) @propertySet `leftMargin` property. Params: propval = Width of the left margin in pixels.bool leftMarginSet() @propertyvoid leftMarginSet(bool propval) @propertyint letterSpacing() @propertyGet `letterSpacing` property. Returns: Extra spacing between graphemes, in Pango units.void letterSpacing(int propval) @propertySet `letterSpacing` property. Params: propval = Extra spacing between graphemes, in Pango units.bool letterSpacingSet() @propertyvoid letterSpacingSet(bool propval) @propertyvoid lineHeight(float propval) @propertySet `lineHeight` property. Params: propval = Factor to scale line height by.bool lineHeightSet() @propertyvoid lineHeightSet(bool propval) @propertypango.types.Overline overline() @propertyGet `overline` property. Returns: Style of overline for this text.void overline(pango.types.Overline propval) @propertySet `overline` property. Params: propval = Style of overline for this text.gdk.rgba.RGBA overlineRgba() @propertyGet `overlineRgba` property. Returns: This property modifies the color of overlines.void overlineRgba(gdk.rgba.RGBA propval) @propertySet `overlineRgba` property. Params: propval = This property modifies the color of overlines.bool overlineRgbaSet() @propertyvoid overlineRgbaSet(bool propval) @propertybool overlineSet() @propertyvoid overlineSet(bool propval) @propertyvoid paragraphBackground(string propval) @propertySet `paragraphBackground` property. Params: propval = The paragraph background color as a string.gdk.rgba.RGBA paragraphBackgroundRgba() @propertyGet `paragraphBackgroundRgba` property. Returns: The paragraph background color as a [gdk.rgba.RGBA].void paragraphBackgroundRgba(gdk.rgba.RGBA propval) @propertySet `paragraphBackgroundRgba` property. Params: propval = The paragraph background color as a [gdk.rgba.RGBA].bool paragraphBackgroundSet() @propertyvoid paragraphBackgroundSet(bool propval) @propertyint pixelsAboveLines() @propertyGet `pixelsAboveLines` property. Returns: Pixels of blank space above paragraphs.void pixelsAboveLines(int propval) @propertySet `pixelsAboveLines` property. Params: propval = Pixels of blank space above paragraphs.bool pixelsAboveLinesSet() @propertyvoid pixelsAboveLinesSet(bool propval) @propertyint pixelsBelowLines() @propertyGet `pixelsBelowLines` property. Returns: Pixels of blank space below paragraphs.void pixelsBelowLines(int propval) @propertySet `pixelsBelowLines` property. Params: propval = Pixels of blank space below paragraphs.bool pixelsBelowLinesSet() @propertyvoid pixelsBelowLinesSet(bool propval) @propertyint pixelsInsideWrap() @propertyGet `pixelsInsideWrap` property. Returns: Pixels of blank space between wrapped lines in a paragraph.void pixelsInsideWrap(int propval) @propertySet `pixelsInsideWrap` property. Params: propval = Pixels of blank space between wrapped lines in a paragraph.bool pixelsInsideWrapSet() @propertyvoid pixelsInsideWrapSet(bool propval) @propertyint rightMargin() @propertyGet `rightMargin` property. Returns: Width of the right margin, in pixels.void rightMargin(int propval) @propertySet `rightMargin` property. Params: propval = Width of the right margin, in pixels.bool rightMarginSet() @propertyvoid rightMarginSet(bool propval) @propertyint rise() @propertyGet `rise` property. Returns: Offset of text above the baseline, in Pango units.void rise(int propval) @propertySet `rise` property. Params: propval = Offset of text above the baseline, in Pango units.bool riseSet() @propertyvoid riseSet(bool propval) @propertydouble scale() @propertyGet `scale` property. Returns: Font size as a scale factor relative to the default font size.void scale(double propval) @propertySet `scale` property. Params: propval = Font size as a scale factor relative to the default font size.bool scaleSet() @propertyvoid scaleSet(bool propval) @propertybool sentence() @propertyGet `sentence` property. Returns: Whether this tag represents a single sentence.void sentence(bool propval) @propertySet `sentence` property. Params: propval = Whether this tag represents a single sentence.bool sentenceSet() @propertyvoid sentenceSet(bool propval) @propertypango.types.ShowFlags showSpaces() @propertyGet `showSpaces` property. Returns: How to render invisible characters.void showSpaces(pango.types.ShowFlags propval) @propertySet `showSpaces` property. Params: propval = How to render invisible characters.bool showSpacesSet() @propertyvoid showSpacesSet(bool propval) @propertyvoid sizePoints(double propval) @propertySet `sizePoints` property. Params: propval = Font size in points.bool sizeSet() @propertyvoid sizeSet(bool propval) @propertypango.types.Stretch stretch() @propertyGet `stretch` property. Returns: Font stretch as a [pango.types.Stretch], e.g. [pango.types.Stretch.Condensed].void stretch(pango.types.Stretch propval) @propertySet `stretch` property. Params: propval = Font stretch as a [pango.types.Stretch], e.g. [pango.types.Stretch.Condensed].bool stretchSet() @propertyvoid stretchSet(bool propval) @propertybool strikethrough() @propertyGet `strikethrough` property. Returns: Whether to strike through the text.void strikethrough(bool propval) @propertySet `strikethrough` property. Params: propval = Whether to strike through the text.gdk.rgba.RGBA strikethroughRgba() @propertyGet `strikethroughRgba` property. Returns: This property modifies the color of strikeouts.void strikethroughRgba(gdk.rgba.RGBA propval) @propertySet `strikethroughRgba` property. Params: propval = This property modifies the color of strikeouts.bool strikethroughRgbaSet() @propertyGet `strikethroughRgbaSet` property. Returns: If the `strikethrough-rgba` property has been set.void strikethroughRgbaSet(bool propval) @propertySet `strikethroughRgbaSet` property. Params: propval = If the `strikethrough-rgba` property has been set.bool strikethroughSet() @propertyvoid strikethroughSet(bool propval) @propertypango.types.Style style() @propertyGet `style` property. Returns: Font style as a [pango.types.Style], e.g. [pango.types.Style.Italic].void style(pango.types.Style propval) @propertySet `style` property. Params: propval = Font style as a [pango.types.Style], e.g. [pango.types.Style.Italic].bool styleSet() @propertyvoid styleSet(bool propval) @propertyvoid tabs(pango.tab_array.TabArray propval) @propertySet `tabs` property. Params: propval = Custom tabs for this text.bool tabsSet() @propertyvoid tabsSet(bool propval) @propertypango.types.TextTransform textTransform() @propertyGet `textTransform` property. Returns: How to transform the text for display.void textTransform(pango.types.TextTransform propval) @propertySet `textTransform` property. Params: propval = How to transform the text for display.bool textTransformSet() @propertyvoid textTransformSet(bool propval) @propertypango.types.Underline underline() @propertyGet `underline` property. Returns: Style of underline for this text.void underline(pango.types.Underline propval) @propertySet `underline` property. Params: propval = Style of underline for this text.gdk.rgba.RGBA underlineRgba() @propertyGet `underlineRgba` property. Returns: This property modifies the color of underlines.void underlineRgba(gdk.rgba.RGBA propval) @propertySet `underlineRgba` property. Params: propval = This property modifies the color of underlines.bool underlineRgbaSet() @propertyGet `underlineRgbaSet` property. Returns: If the `underline-rgba` property has been set.void underlineRgbaSet(bool propval) @propertySet `underlineRgbaSet` property. Params: propval = If the `underline-rgba` property has been set.bool underlineSet() @propertyvoid underlineSet(bool propval) @propertypango.types.Variant variant() @propertyGet `variant` property. Returns: Font variant as a [pango.types.Variant], e.g. [pango.types.Variant.SmallCaps].void variant(pango.types.Variant propval) @propertySet `variant` property. Params: propval = Font variant as a [pango.types.Variant], e.g. [pango.types.Variant.SmallCaps].bool variantSet() @propertyvoid variantSet(bool propval) @propertyvoid weight(int propval) @propertySet `weight` property. Params: propval = Font weight as an integer.bool weightSet() @propertyvoid weightSet(bool propval) @propertyvoid word(bool propval) @propertySet `word` property. Params: propval = Whether this tag represents a single word.bool wordSet() @propertyvoid wordSet(bool propval) @propertygtk.types.WrapMode wrapMode() @propertyGet `wrapMode` property. Returns: Whether to wrap lines never, at word boundaries, or at character boundaries.void wrapMode(gtk.types.WrapMode propval) @propertySet `wrapMode` property. Params: propval = Whether to wrap lines never, at word boundaries, or at character boundaries.bool wrapModeSet() @propertyvoid wrapModeSet(bool propval) @propertyvoid changed(bool sizeChanged)Emits the `signalGtk.TextTagTable::tag-changed` signal on the [gtk.texttagtable.TextTagTable] where the tag is included.int getPriority()Get the tag priority. Returns: The tag’s priority.void setPriority(int priority)Sets the priority of a [gtk.text_tag.TextTag].Methods
T accumulativeMargin(bool propval)Set `accumulativeMargin` property. Params: propval = Whether the margins accumulate or override each other.T allowBreaks(bool propval)Set `allowBreaks` property. Params: propval = Whether breaks are allowed. Returns: Builder instance for fluent chainingT allowBreaksSet(bool propval)T background(string propval)Set `background` property. Params: propval = Background color as a string. Returns: Builder instance for fluent chainingT backgroundFullHeight(bool propval)Set `backgroundFullHeight` property. Params: propval = Whether the background color fills the entire line height or only the height of the tagged characters. Returns: Builder instance for fluent ch...T backgroundFullHeightSet(bool propval)T backgroundRgba(gdk.rgba.RGBA propval)Set `backgroundRgba` property. Params: propval = Background color as a [gdk.rgba.RGBA]. Returns: Builder instance for fluent chainingT backgroundSet(bool propval)T direction(gtk.types.TextDirection propval)Set `direction` property. Params: propval = Text direction, e.g. right-to-left or left-to-right. Returns: Builder instance for fluent chainingT editable(bool propval)Set `editable` property. Params: propval = Whether the text can be modified by the user. Returns: Builder instance for fluent chainingT editableSet(bool propval)T fallback(bool propval)Set `fallback` property. Params: propval = Whether font fallback is enabled.T fallbackSet(bool propval)T family(string propval)Set `family` property. Params: propval = Name of the font family, e.g. Sans, Helvetica, Times, Monospace. Returns: Builder instance for fluent chainingT familySet(bool propval)T font(string propval)Set `font` property. Params: propval = Font description as string, e.g. \"Sans Italic 12\".T fontDesc(pango.font_description.FontDescription propval)Set `fontDesc` property. Params: propval = Font description as a [pango.font_description.FontDescription]. Returns: Builder instance for fluent chainingT fontFeatures(string propval)Set `fontFeatures` property. Params: propval = OpenType font features, as a string. Returns: Builder instance for fluent chainingT fontFeaturesSet(bool propval)T foreground(string propval)Set `foreground` property. Params: propval = Foreground color as a string. Returns: Builder instance for fluent chainingT foregroundRgba(gdk.rgba.RGBA propval)Set `foregroundRgba` property. Params: propval = Foreground color as a [gdk.rgba.RGBA]. Returns: Builder instance for fluent chainingT foregroundSet(bool propval)T indent(int propval)Set `indent` property. Params: propval = Amount to indent the paragraph, in pixels.T indentSet(bool propval)T insertHyphens(bool propval)Set `insertHyphens` property. Params: propval = Whether to insert hyphens at breaks. Returns: Builder instance for fluent chainingT insertHyphensSet(bool propval)T invisible(bool propval)Set `invisible` property. Params: propval = Whether this text is hidden.T invisibleSet(bool propval)T justification(gtk.types.Justification propval)Set `justification` property. Params: propval = Left, right, or center justification. Returns: Builder instance for fluent chainingT justificationSet(bool propval)T language(string propval)Set `language` property. Params: propval = The language this text is in, as an ISO code.T languageSet(bool propval)T leftMargin(int propval)Set `leftMargin` property. Params: propval = Width of the left margin in pixels. Returns: Builder instance for fluent chainingT leftMarginSet(bool propval)T letterSpacing(int propval)Set `letterSpacing` property. Params: propval = Extra spacing between graphemes, in Pango units. Returns: Builder instance for fluent chainingT letterSpacingSet(bool propval)T lineHeight(float propval)Set `lineHeight` property. Params: propval = Factor to scale line height by. Returns: Builder instance for fluent chainingT lineHeightSet(bool propval)T name(string propval)Set `name` property. Params: propval = The name used to refer to the tag.T overline(pango.types.Overline propval)Set `overline` property. Params: propval = Style of overline for this text. Returns: Builder instance for fluent chainingT overlineRgba(gdk.rgba.RGBA propval)Set `overlineRgba` property. Params: propval = This property modifies the color of overlines.T overlineRgbaSet(bool propval)T overlineSet(bool propval)T paragraphBackground(string propval)Set `paragraphBackground` property. Params: propval = The paragraph background color as a string. Returns: Builder instance for fluent chainingT paragraphBackgroundRgba(gdk.rgba.RGBA propval)Set `paragraphBackgroundRgba` property. Params: propval = The paragraph background color as a [gdk.rgba.RGBA]. Returns: Builder instance for fluent chainingT paragraphBackgroundSet(bool propval)T pixelsAboveLines(int propval)Set `pixelsAboveLines` property. Params: propval = Pixels of blank space above paragraphs. Returns: Builder instance for fluent chainingT pixelsAboveLinesSet(bool propval)T pixelsBelowLines(int propval)Set `pixelsBelowLines` property. Params: propval = Pixels of blank space below paragraphs. Returns: Builder instance for fluent chainingT pixelsBelowLinesSet(bool propval)T pixelsInsideWrap(int propval)Set `pixelsInsideWrap` property. Params: propval = Pixels of blank space between wrapped lines in a paragraph. Returns: Builder instance for fluent chainingT pixelsInsideWrapSet(bool propval)T rightMargin(int propval)Set `rightMargin` property. Params: propval = Width of the right margin, in pixels. Returns: Builder instance for fluent chainingT rightMarginSet(bool propval)T rise(int propval)Set `rise` property. Params: propval = Offset of text above the baseline, in Pango units.T riseSet(bool propval)T scale(double propval)Set `scale` property. Params: propval = Font size as a scale factor relative to the default font size.T scaleSet(bool propval)T sentence(bool propval)Set `sentence` property. Params: propval = Whether this tag represents a single sentence.T sentenceSet(bool propval)T showSpaces(pango.types.ShowFlags propval)Set `showSpaces` property. Params: propval = How to render invisible characters. Returns: Builder instance for fluent chainingT showSpacesSet(bool propval)T size(int propval)Set `size` property. Params: propval = Font size in Pango units. Returns: Builder instance for fluent chainingT sizePoints(double propval)Set `sizePoints` property. Params: propval = Font size in points. Returns: Builder instance for fluent chainingT sizeSet(bool propval)T stretch(pango.types.Stretch propval)Set `stretch` property. Params: propval = Font stretch as a [pango.types.Stretch], e.g. [pango.types.Stretch.Condensed]. Returns: Builder instance for fluent chainingT stretchSet(bool propval)T strikethrough(bool propval)Set `strikethrough` property. Params: propval = Whether to strike through the text. Returns: Builder instance for fluent chainingT strikethroughRgba(gdk.rgba.RGBA propval)Set `strikethroughRgba` property. Params: propval = This property modifies the color of strikeouts.T strikethroughRgbaSet(bool propval)Set `strikethroughRgbaSet` property. Params: propval = If the `strikethrough-rgba` property has been set. Returns: Builder instance for fluent chainingT strikethroughSet(bool propval)T style(pango.types.Style propval)Set `style` property. Params: propval = Font style as a [pango.types.Style], e.g. [pango.types.Style.Italic]. Returns: Builder instance for fluent chainingT styleSet(bool propval)T tabs(pango.tab_array.TabArray propval)Set `tabs` property. Params: propval = Custom tabs for this text. Returns: Builder instance for fluent chainingT tabsSet(bool propval)T textTransform(pango.types.TextTransform propval)Set `textTransform` property. Params: propval = How to transform the text for display. Returns: Builder instance for fluent chainingT textTransformSet(bool propval)T underline(pango.types.Underline propval)Set `underline` property. Params: propval = Style of underline for this text. Returns: Builder instance for fluent chainingT underlineRgba(gdk.rgba.RGBA propval)Set `underlineRgba` property. Params: propval = This property modifies the color of underlines.T underlineRgbaSet(bool propval)Set `underlineRgbaSet` property. Params: propval = If the `underline-rgba` property has been set. Returns: Builder instance for fluent chainingT underlineSet(bool propval)T variant(pango.types.Variant propval)Set `variant` property. Params: propval = Font variant as a [pango.types.Variant], e.g. [pango.types.Variant.SmallCaps]. Returns: Builder instance for fluent chainingT variantSet(bool propval)T weight(int propval)Set `weight` property. Params: propval = Font weight as an integer. Returns: Builder instance for fluent chainingT weightSet(bool propval)T word(bool propval)Set `word` property. Params: propval = Whether this tag represents a single word.T wordSet(bool propval)T wrapMode(gtk.types.WrapMode propval)Set `wrapMode` property. Params: propval = Whether to wrap lines never, at word boundaries, or at character boundaries. Returns: Builder instance for fluent chainingT wrapModeSet(bool propval)