GooCanvas.CanvasWidget

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.CanvasWidget GooCanvas.CanvasWidget GooCanvas.CanvasItemSimple->GooCanvas.CanvasWidget

Subclasses:

None

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

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

anchor

GooCanvas.CanvasAnchorType

r/w

How to position the widget relative to the item’s x and y coordinate settings

height

float

r/w

The height of the widget, or -1 to use its requested height

widget

Gtk.Widget

r/w

The widget to place in the canvas

width

float

r/w

The width of the widget, or -1 to use its requested width

x

float

r/w

The x coordinate of the widget

y

float

r/w

The y coordinate of the widget

Signals

Inherited:

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

Fields

Inherited:

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

Name

Type

Access

Description

anchor

GooCanvas.CanvasAnchorType

r

height

float

r

parent_object

GooCanvas.CanvasItemSimple

r

widget

Gtk.Widget

r

width

float

r

x

float

r

y

float

r

Class Details

class GooCanvas.CanvasWidget(**kwargs)
Bases:

GooCanvas.CanvasItemSimple

Abstract:

No

Structure:

GooCanvas.CanvasWidgetClass

GooCanvas.CanvasWidget provides support for placing any Gtk.Widget in the canvas.

The GooCanvas.CanvasWidget :width and GooCanvas.CanvasWidget :height properties specify the widget’s size. If either of them is -1, then the requested size of the widget is used instead, which is the default for both width and height.

Note that there are a number of limitations in the use of GooCanvas.CanvasWidget:

  • It doesn’t support any transformation besides GooCanvas.simple translation. This means you can’t scale a canvas with a GooCanvas.CanvasWidget in it.

  • It doesn’t support layering, so you can’t place other items beneath or above the GooCanvas.CanvasWidget.

  • It doesn’t support rendering of widgets to a given cairo.Context, which means you can’t output the widget to a pdf or postscript file.

  • It doesn’t have a model/view variant like the other standard items, so it can only be used in a GooCanvas.simple canvas without a model.

  • It can’t be made a static item.

Property Details

GooCanvas.CanvasWidget.props.anchor
Name:

anchor

Type:

GooCanvas.CanvasAnchorType

Default Value:

GooCanvas.CanvasAnchorType.NORTH_WEST

Flags:

READABLE, WRITABLE

How to position the widget relative to the item’s x and y coordinate settings

GooCanvas.CanvasWidget.props.height
Name:

height

Type:

float

Default Value:

-1.0

Flags:

READABLE, WRITABLE

The height of the widget, or -1 to use its requested height

GooCanvas.CanvasWidget.props.widget
Name:

widget

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE

The widget to place in the canvas

GooCanvas.CanvasWidget.props.width
Name:

width

Type:

float

Default Value:

-1.0

Flags:

READABLE, WRITABLE

The width of the widget, or -1 to use its requested width

GooCanvas.CanvasWidget.props.x
Name:

x

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The x coordinate of the widget

GooCanvas.CanvasWidget.props.y
Name:

y

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The y coordinate of the widget