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