gtk.TextAttributes
Prev | The gtk Class Reference | Next

## gtk.TextAttributes

gtk.TextAttributes — an object containing the attributes set on some text

## Synopsis

    class gtk.TextAttributes(gobject.GBoxed):
        gtk.TextAttributes()
        def copy()
        def copy_values(dest)

## Attributes

"bg_color" | Read | The background color
"fg_color" | Read | The foreground color
"bg_stipple" | Read | The background stipple bitmap
"fg_stipple" | Read | The foreground stipple bitmap
"rise" | Read | The subscript or superscript rise
"underline" | Read | The style of underline - one of: `pango.UNDERLINE_NONE`, `pango.UNDERLINE_SINGLE`, `pango.UNDERLINE_DOUBLE`, `pango.UNDERLINE_LOW`
"strikethrough" | Read | If `True` strikethrough the text
"draw_bg" | Read | If `True` some background attributes are set
"justification" | Read | The type of justification - one of: `gtk.JUSTIFY_LEFT`, `gtk.JUSTIFY_RIGHT`, `gtk.JUSTIFY_CENTER`, `gtk.JUSTIFY_FILL`
"direction" | Read | The text direction - one of: `gtk.TEXT_DIR_NONE`, `gtk.TEXT_DIR_LTR`, `gtk.TEXT_DIR_RTL`
"font" | Read | A `pango.FontDescription`
"font_scale" | Read | The scale of the font e.g. 2.5
"left_margin" | Read | The width of the left margin in pixels
"indent" | Read | The width of the paragraph indent in pixels
"right_margin" | Read | The width of the right margin
"pixels_above_lines" | Read | The number of pixels space above a paragraph
"pixels_below_lines" | Read | The number of pixels space below a paragraph
"pixels_inside_wrap" | Read | The number of pixels of space between wrapped lines in a paragraph
"tabs" | Read | A set of tabs contained in a `pango.TabArray`
"wrap_mode" | Read | The wrap mode - one of: `gtk.WRAP_NONE`, `gtk.WRAP_CHAR`, `gtk.WRAP_WORD`
"language" | Read | The `pango.Language` object describing the text language
"invisible" | Read | If `True` the text is hidden (Not implemented in PyGTK2)
"bg_full_height" | Read | If `True` the background is fit to the full line height
"editable" | Read | If `True` the text is editable
"realized" | Read | If `True` the text has been realized
"pad1" | Read |
"pad2" | Read |
"pad3" | Read |
"pad4" | Read |

## Description

A `gtk.TextAttributes` object holds a set of attributes that describe the properties of a section of text. A `gtk.TextAttributes` object is usually obtained by calling either of the `gtk.TextIter.get_attributes`() or `gtk.TextView.get_default_attributes`() methods to retrieve the attributes in effect.

A `gtk.TextAttributes` object created with gtk.TextAttributes() cannot be applied within PyGTK because there is no way to set the attributes. Likewise, the `copy`() and `copy_values`() methods can create a new copy or copy the attributes but there are no methods in PyGTK that take a `gtk.TextAttributes` object as an argument. The most effective way to use a `gtk.TextAttributes` object is to read its attributes and use them to set the properties of a `gtk.TextTag`.

## Constructor

        gtk.TextAttributes()

Returns : | a new `gtk.TextAttributes`

Creates a `gtk.TextAttributes` object, that contains a set of attributes of some text.

## Methods

### gtk.TextAttributes.copy

        def copy()

Returns : | a copy of the `gtk.TextAttributes` object

The `copy`() method copies the text attributes and returns a new `gtk.TextAttributes` object.

### gtk.TextAttributes.copy_values

        def copy_values(dest)

`dest` : | the `gtk.TextAttributes` whose attributes will be set

The `copy_values`() method copies the values from the `gtk.TextAttributes` object to `dest` so that `dest` has the same values. Frees existing values in `dest`.

Prev | Up | Next
gtk.TearoffMenuItem | Home | gtk.TextBuffer