goocanvas.RectModel — A model for rectangle items.
class goocanvas.RectModel(goocanvas.ItemModelModelSimple): |
|
goocanvas.RectModel
represents a model for rectangle items. It is a subclass of
goocanvas.ItemModelModelSimple
and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".
It also implements the goocanvas.ItemModel
interface, so you can use the goocanvas.ItemModel
functions such as goocanvas.ItemModel.raise_()
and goocanvas.ItemModel.rotate()
goocanvas.RectModel(properties
=None)
| A comma separated list of properties. |
Returns : | A new
goocanvas.RectModel
|
Creates a new canvas rect model 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.RectModel(parent=root, x=100, y=100, width=200, height=100, stroke_color="red", fill_color="blue", line_width=5.0)