goocanvas.Rect — A rectangle item.
|
goocanvas.Rect
represents a rectangle 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.RectView
object.
(See goocanvas.CanvasView.get_item_view()
and goocanvas.CanvasView
signal
"item-view-created")
goocanvas.Rect(properties
=None)
properties : | A comma separated list of properties. |
Returns : | A new
goocanvas.Rect
|
Creates a new canvas rect item.
Here's an example showing how to create a rectangle at (100,100) with a width of 200 and a height of 100.
rect = goocanvas.Rect(x=100, y=100, width=200, height=100, stroke_color="red", fill_color="blue", line_width=5.0)