goocanvas.Widget

goocanvas.Widget — An embedded widget item.

Synopsis

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

Ancestry

+-- gobject.GObject
	+-- goocanvas.ItemSimple
		+-- goocanvas.Widget

goocanvas.Widget Properties

"anchor"Read/WriteHow to position the widget relative to the item's x and y coordinate settings. Default value: gtk.ANCHOR_NORTH_WEST
"height"Read/WriteThe height of the widget, or -1 to use its requested height. Default value: -1
"widget"Read/WriteThe widget to place in the canvas.
"width"Read/WriteThe width of the widget, or -1 to use its requested width. Default value: -1
"x"Read/WriteThe x coordinate of the widget. Default value: 0
"y"Read/Writehe y coordinate of the widget. Default value: 0

Implemented Interfaces

goocanvas.Widget implements goocanvas.Item

Description

goocanvas.Widget provides support for placing any GtkWidget in the canvas. Note that there are a number of limitations in the use of GooCanvasWidget: It doesn't support any transformation besides simple translation. This means you can't scale a canvas with a GooCanvasWidget in it. It doesn't support layering, so you can't place other items beneath or above the GooCanvasWidget. It doesn't support rendering of widgets to a given cairo_t, 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 simple canvas without a model.

Constructor

    goocanvas.Widget(properties=None)

properties :

A comma separated properties as **kwargs.

Returns :

A new goocanvas.Widget

Creates a new canvas widget item.

Here's an example showing how to create an entry widget centered at (100.0, 100.0):

entry = gtk.Entry()
ellipse = goocanvas.Widget(parent = root,
                           widget = entry,
                           x = 100,
                           y = 100,
                           width = -1,
                           height = -1,
                           anchor = gtk.ANCHOR_CENTER)