goocanvas.RectModel — A model for rectangle items.
goocanvas.RectModel extends, goocanvas.ItemModelModelSimple {goocanvas.RectModel(properties= None);
}
"height" Read/Write The height of the rectangle. Allowed values: >= 0. Default value: 0. "radius_x" Read/Write The horizontal radius to use for rounded corners. Allowed values: >= 0. Default value: 0. "radius_y" Read/Write The vertical radius to use for rounded corners. Allowed values: >= 0. Default value: 0. "width" Read/Write The width of the rectangle. Allowed values: >= 0. Default value: 0. "x" Read/Write The x coordinate of the rectangle. Default value: 0. "y" Read/Write The y coordinate of the rectangle. Default value: 0.
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)