goocanvas.Text

goocanvas.Text — A text item.

Synopsis

class goocanvas.Text(goocanvas.ItemSimple):
    goocanvas.Text(properties=None)

Ancestry

+-- gobject.GObject
	+-- goocanvas.ItemSimple
		+-- goocanvas.Text

goocanvas.Text Properties

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

Implemented Interfaces

goocanvas.Text implements goocanvas.Item

Description

goocanvas.Text represents a text item. It is a subclass of goocanvas.ItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". It also implements the goocanvas.Item interface, so you can use the goocanvas.Item functions such as goocanvas.Item.raise_() and goocanvas.Item.rotate() To respond to events such as mouse clicks on the ellipse you must connect to the signal handlers of the corresponding goocanvas.TextView object. (See goocanvas.CanvasView.get_item_view() and goocanvas.CanvasView signal "item-view-created")

Constructor

    goocanvas.Text(properties=None)
properties :A comma separated list of properties.
Returns :A new goocanvas.Text

Creates a new canvas text item.

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

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