Description
A tag that can be applied to text in a GtkTextBufferHierarchy
GObject
+----GtkTextTag
Detailed Description
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 GtkTextTagTable
for a given GtkTextBuffer
before using them with that buffer.
gtkTextBufferCreateTag
is the best way to create tags.
See gtk-demo
for numerous examples. The "invisible" property was not implemented for GTK+ 2.0.
It is working (with minor issues) since 2.8.Structures
GtkTextTag
-
undocumented
GtkTextAttributes
-
Using
GtkTextAttributes
directly should rarely be necessary. It's
primarily useful with gtkTextIterGetAttributes
. As with most
GTK+ structs, the fields in this struct should only be read, never
modified directly.
appearance
- [
GtkTextAppearance
] pointer to sub-struct containing certain attributes justification
- [
GtkJustification
] direction
- [
GtkTextDirection
] font
- [
PangoFontDescription
] fontScale
- [numeric]
leftMargin
- [integer]
indent
- [integer]
rightMargin
- [integer]
pixelsAboveLines
- [integer]
pixelsBelowLines
- [integer]
pixelsInsideWrap
- [integer]
tabs
- [
PangoTabArray
] wrapMode
- [
GtkWrapMode
] language
- [
PangoLanguage
] invisible
- [numeric]
bgFullHeight
- [numeric]
editable
- [numeric]
realized
- [numeric]
GtkTextAppearance
-
undocumented
bgColor
- [
GdkColor
] fgColor
- [
GdkColor
] bgStipple
- [
GdkBitmap
] fgStipple
- [
GdkBitmap
] rise
- [integer]
underline
- [numeric]
strikethrough
- [numeric]
drawBg
- [numeric]
Convenient Construction
gtkTextTag
is the equivalent of gtkTextTagNew
.Properties
accumulative-margin
[logical : Read / Write]- 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 to FALSE
the margins override one another (the default).
Default value: FALSE Since 2.12 background
[character : * : Write]- Background color as a string. Default value: NULL
background-full-height
[logical : Read / Write]- Whether the background color fills the entire line height or only the height of the tagged characters. Default value: FALSE
background-full-height-set
[logical : Read / Write]- Whether this tag affects background height. Default value: FALSE
background-gdk
[GdkColor
: * : Read / Write]- Background color as a (possibly unallocated) GdkColor.
background-set
[logical : Read / Write]- Whether this tag affects the background color. Default value: FALSE
background-stipple
[GdkPixmap
: * : Read / Write]- Bitmap to use as a mask when drawing the text background.
background-stipple-set
[logical : Read / Write]- Whether this tag affects the background stipple. Default value: FALSE
direction
[GtkTextDirection
: Read / Write]- Text direction, e.g. right-to-left or left-to-right. Default value: GTK_TEXT_DIR_NONE
editable
[logical : Read / Write]- Whether the text can be modified by the user. Default value: TRUE
editable-set
[logical : Read / Write]- Whether this tag affects text editability. Default value: FALSE
family
[character : * : Read / Write]- Name of the font family, e.g. Sans, Helvetica, Times, Monospace. Default value: NULL
family-set
[logical : Read / Write]- Whether this tag affects the font family. Default value: FALSE
font
[character : * : Read / Write]- Font description as string, e.g. \"Sans Italic 12\". Note that the initial value of this property depends on
the internals of
PangoFontDescription
.
Default value: NULL font-desc
[PangoFontDescription
: * : Read / Write]- Font description as a PangoFontDescription struct.
foreground
[character : * : Write]- Foreground color as a string. Default value: NULL
foreground-gdk
[GdkColor
: * : Read / Write]- Foreground color as a (possibly unallocated) GdkColor.
foreground-set
[logical : Read / Write]- Whether this tag affects the foreground color. Default value: FALSE
foreground-stipple
[GdkPixmap
: * : Read / Write]- Bitmap to use as a mask when drawing the text foreground.
foreground-stipple-set
[logical : Read / Write]- Whether this tag affects the foreground stipple. Default value: FALSE
indent
[integer : Read / Write]- Amount to indent the paragraph, in pixels. Default value: 0
indent-set
[logical : Read / Write]- Whether this tag affects indentation. Default value: FALSE
invisible
[logical : Read / Write]- 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.
Default value: FALSE Since 2.8
invisible-set
[logical : Read / Write]- Whether this tag affects text visibility. Default value: FALSE
justification
[GtkJustification
: Read / Write]- Left, right, or center justification. Default value: GTK_JUSTIFY_LEFT
justification-set
[logical : Read / Write]- Whether this tag affects paragraph justification. Default value: FALSE
language
[character : * : Read / Write]- 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
gtkGetDefaultLanguage
.
Default value: NULL language-set
[logical : Read / Write]- Whether this tag affects the language the text is rendered as. Default value: FALSE
left-margin
[integer : Read / Write]- Width of the left margin in pixels. Allowed values: >= 0 Default value: 0
left-margin-set
[logical : Read / Write]- Whether this tag affects the left margin. Default value: FALSE
name
[character : * : Read / Write / Construct Only]- Name used to refer to the text tag. NULL for anonymous tags. Default value: NULL
paragraph-background
[character : * : Write]- The paragraph background color as a string.
Default value: NULL Since 2.8
paragraph-background-gdk
[GdkColor
: * : Read / Write]- The paragraph background color as a as a (possibly unallocated)
GdkColor
.
Since 2.8 paragraph-background-set
[logical : Read / Write]- Whether this tag affects the paragraph background color. Default value: FALSE
pixels-above-lines
[integer : Read / Write]- Pixels of blank space above paragraphs. Allowed values: >= 0 Default value: 0
pixels-above-lines-set
[logical : Read / Write]- Whether this tag affects the number of pixels above lines. Default value: FALSE
pixels-below-lines
[integer : Read / Write]- Pixels of blank space below paragraphs. Allowed values: >= 0 Default value: 0
pixels-below-lines-set
[logical : Read / Write]- Whether this tag affects the number of pixels above lines. Default value: FALSE
pixels-inside-wrap
[integer : Read / Write]- Pixels of blank space between wrapped lines in a paragraph. Allowed values: >= 0 Default value: 0
pixels-inside-wrap-set
[logical : Read / Write]- Whether this tag affects the number of pixels between wrapped lines. Default value: FALSE
right-margin
[integer : Read / Write]- Width of the right margin in pixels. Allowed values: >= 0 Default value: 0
right-margin-set
[logical : Read / Write]- Whether this tag affects the right margin. Default value: FALSE
rise
[integer : Read / Write]- Offset of text above the baseline (below the baseline if rise is negative) in Pango units. Default value: 0
rise-set
[logical : Read / Write]- Whether this tag affects the rise. Default value: FALSE
scale
[numeric : Read / Write]- 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. Allowed values: >= 0 Default value: 1
scale-set
[logical : Read / Write]- Whether this tag scales the font size by a factor. Default value: FALSE
size
[integer : Read / Write]- Font size in Pango units. Allowed values: >= 0 Default value: 0
size-points
[numeric : Read / Write]- Font size in points. Allowed values: >= 0 Default value: 0
size-set
[logical : Read / Write]- Whether this tag affects the font size. Default value: FALSE
stretch
[PangoStretch
: Read / Write]- Font stretch as a PangoStretch, e.g. PANGO_STRETCH_CONDENSED. Default value: PANGO_STRETCH_NORMAL
stretch-set
[logical : Read / Write]- Whether this tag affects the font stretch. Default value: FALSE
strikethrough
[logical : Read / Write]- Whether to strike through the text. Default value: FALSE
strikethrough-set
[logical : Read / Write]- Whether this tag affects strikethrough. Default value: FALSE
style
[PangoStyle
: Read / Write]- Font style as a PangoStyle, e.g. PANGO_STYLE_ITALIC. Default value: PANGO_STYLE_NORMAL
style-set
[logical : Read / Write]- Whether this tag affects the font style. Default value: FALSE
tabs
[PangoTabArray
: * : Read / Write]- Custom tabs for this text.
tabs-set
[logical : Read / Write]- Whether this tag affects tabs. Default value: FALSE
underline
[PangoUnderline
: Read / Write]- Style of underline for this text. Default value: PANGO_UNDERLINE_NONE
underline-set
[logical : Read / Write]- Whether this tag affects underlining. Default value: FALSE
variant
[PangoVariant
: Read / Write]- Font variant as a PangoVariant, e.g. PANGO_VARIANT_SMALL_CAPS. Default value: PANGO_VARIANT_NORMAL
variant-set
[logical : Read / Write]- Whether this tag affects the font variant. Default value: FALSE
weight
[integer : Read / Write]- Font weight as an integer, see predefined values in PangoWeight; for example, PANGO_WEIGHT_BOLD. Allowed values: >= 0 Default value: 400
weight-set
[logical : Read / Write]- Whether this tag affects the font weight. Default value: FALSE
wrap-mode
[GtkWrapMode
: Read / Write]- Whether to wrap lines never, at word boundaries, or at character boundaries. Default value: GTK_WRAP_NONE
wrap-mode-set
[logical : Read / Write]- Whether this tag affects line wrap mode. Default value: FALSE