goocanvas.TextModel
Prev | PyGooCanvas Canvas Item Models Reference | Next

## goocanvas.TextModel

goocanvas.TextModel — A model for text items.

## Synopsis

    class goocanvas.TextModel(goocanvas.ItemModelModelSimple):
        goocanvas.TextModel(properties=None)

## Ancestry

    +-- gobject.GObject
    	+-- goocanvas.ItemModelModelSimple
    		+-- goocanvas.TextModel

## goocanvas.TextModel Properties

"alignment" | Read/Write | How to align the text. Default value: pango.ALIGN_LEFT.
"anchor" | Read/Write | How to position the text relative to the given x and y coordinates. Default value: gtk.ANCHOR_NORTH_WEST.
"font" | Read/Write | The base font to use for the text. Default value: None.
"font-desc" | Read/Write | The attributes specifying which font to use.
"text" | Read/Write | The text to display. Default value: None.
"use-markup" | Read/Write | Whether to parse PangoMarkup in the text, to support different styles. Default value: False.
"width" | Read/Write | The width to use to layout the text. Default value: -1.
"x" | Read/Write | The x coordinate of the text. Default value: 0.
"y" | Read/Write | The y coordinate of the text. Default value: 0.

## Implemented Interfaces

`goocanvas.TextModel` implements `goocanvas.ItemModel`

## Description

`goocanvas.TextModel` represents a text item. It is a subclass of `goocanvas.ItemModelModelSimple` and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". It also implements the `goocanvas.ItemModel` interface, so you can use the `goocanvas.ItemModel` functions such as `goocanvas.ItemModel.raise_()` and `goocanvas.ItemModel.rotate()`

## Constructor

        goocanvas.TextModel(properties=None)

`properties` : | A comma separated list of properties.
Returns : | A new `goocanvas.TextModel`

Creates a new canvas text model item.

Here's an example showing how to create a text model item with the bottom right of the text box placed at (500,500):

    text = goocanvas.TextModel(parent=root,
                               text="Hello, World!",
                               x=500,
                               y=500,
                               width=200,
                               anchor=gtk.ANCHOR_SE,
                               fill_color="blue")

Prev | Up | Next
goocanvas.RectModel | Home | goocanvas.TableModel