GooCanvas.CanvasText

g GObject.GInterface GObject.GInterface GooCanvas.CanvasItem GooCanvas.CanvasItem GObject.GInterface->GooCanvas.CanvasItem GObject.Object GObject.Object GooCanvas.CanvasItemSimple GooCanvas.CanvasItemSimple GObject.Object->GooCanvas.CanvasItemSimple GooCanvas.CanvasItem->GooCanvas.CanvasItemSimple GooCanvas.CanvasText GooCanvas.CanvasText GooCanvas.CanvasItemSimple->GooCanvas.CanvasText

Subclasses:

None

Methods

Inherited:

GooCanvas.CanvasItemSimple (9), GObject.Object (37), GooCanvas.CanvasItem (48)

Structs:

GObject.ObjectClass (5)

get_natural_extents ()

Virtual Methods

Inherited:

GooCanvas.CanvasItemSimple (4), GObject.Object (7), GooCanvas.CanvasItem (44)

Properties

Inherited:

GooCanvas.CanvasItemSimple (23), GooCanvas.CanvasItem (9)

Name

Type

Flags

Short Description

alignment

Pango.Alignment

r/w

How to align the text

anchor

GooCanvas.CanvasAnchorType

r/w

How to position the text relative to the given x and y coordinates

ellipsize

Pango.EllipsizeMode

r/w

The preferred place to ellipsize the string, if the label does not have enough room to display the entire string

height

float

r/w

The height to use to layout the text, or -1 to let the text use as much vertical space as needed

text

str

r/w

The text to display

use-markup

bool

r/w

Whether to parse PangoMarkup in the text, to support different styles

width

float

r/w

The width to use to layout the text, or -1 to let the text use as much horizontal space as needed

wrap

Pango.WrapMode

r/w

The preferred method of wrapping the string if a width has been set

x

float

r/w

The x coordinate of the text

y

float

r/w

The y coordinate of the text

Signals

Inherited:

GObject.Object (1), GooCanvas.CanvasItem (14)

Fields

Inherited:

GObject.Object (1), GooCanvas.CanvasItem (14)

Name

Type

Access

Description

layout_width

float

r

parent

GooCanvas.CanvasItemSimple

r

text_data

GooCanvas.CanvasTextData

r

Class Details

class GooCanvas.CanvasText(**kwargs)
Bases:

GooCanvas.CanvasItemSimple

Abstract:

No

Structure:

GooCanvas.CanvasTextClass

GooCanvas.CanvasText represents a text item.

It is a subclass of GooCanvas.CanvasItemSimple and so inherits all of the style properties such as “fill-color”.

It also implements the GooCanvas.CanvasItem interface, so you can use the GooCanvas.CanvasItem functions such as GooCanvas.CanvasItem.raise_() and GooCanvas.CanvasItem.rotate().

The GooCanvas.CanvasText :width and GooCanvas.CanvasText :height properties specify the area of the item. If it exceeds that area because there is too much text, it is clipped. The properties can be set to -1 to disable clipping.

To create a GooCanvas.CanvasText use goo_canvas_text_new().

To get or set the properties of an existing GooCanvas.CanvasText, use g_object_get() and g_object_set().

get_natural_extents()
Returns:

ink_rect:

the location to return the ink rect, or None.

logical_rect:

the location to return the logical rect, or None.

Return type:

(ink_rect: Pango.Rectangle, logical_rect: Pango.Rectangle)

Gets the natural extents of the text, in the text item’s coordinate space.

The final extents of the text may be different, if the text item is placed in a layout container such as GooCanvas.CanvasTable.

Property Details

GooCanvas.CanvasText.props.alignment
Name:

alignment

Type:

Pango.Alignment

Default Value:

Pango.Alignment.LEFT

Flags:

READABLE, WRITABLE

How to align the text

GooCanvas.CanvasText.props.anchor
Name:

anchor

Type:

GooCanvas.CanvasAnchorType

Default Value:

GooCanvas.CanvasAnchorType.NORTH_WEST

Flags:

READABLE, WRITABLE

How to position the text relative to the given x and y coordinates

GooCanvas.CanvasText.props.ellipsize
Name:

ellipsize

Type:

Pango.EllipsizeMode

Default Value:

Pango.EllipsizeMode.NONE

Flags:

READABLE, WRITABLE

The preferred place to ellipsize the string, if the label does not have enough room to display the entire string

GooCanvas.CanvasText.props.height
Name:

height

Type:

float

Default Value:

-1.0

Flags:

READABLE, WRITABLE

The height to use to layout the text, or -1 to let the text use as much vertical space as needed

GooCanvas.CanvasText.props.text
Name:

text

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The text to display

GooCanvas.CanvasText.props.use_markup
Name:

use-markup

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether to parse PangoMarkup in the text, to support different styles

GooCanvas.CanvasText.props.width
Name:

width

Type:

float

Default Value:

-1.0

Flags:

READABLE, WRITABLE

The width to use to layout the text, or -1 to let the text use as much horizontal space as needed

GooCanvas.CanvasText.props.wrap
Name:

wrap

Type:

Pango.WrapMode

Default Value:

Pango.WrapMode.WORD

Flags:

READABLE, WRITABLE

The preferred method of wrapping the string if a width has been set

GooCanvas.CanvasText.props.x
Name:

x

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The x coordinate of the text

GooCanvas.CanvasText.props.y
Name:

y

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The y coordinate of the text