goocanvas.RectModel
Prev | PyGooCanvas Canvas Item Models Reference | Next

## goocanvas.RectModel

goocanvas.RectModel — A model for rectangle items.

## Synopsis

    class goocanvas.RectModel(goocanvas.ItemModelModelSimple):
        goocanvas.RectModel(properties=None)

## Ancestry

    +-- gobject.GObject
    	+-- goocanvas.ItemModelModelSimple
    		+-- goocanvas.RectModel

## goocanvas.RectModel Properties

"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.

## Implemented Interfaces

`goocanvas.RectModel` implements `goocanvas.ItemModel`

## Description

`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()`

## Constructor

        goocanvas.RectModel(properties=None)

`properties`: | 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)

Prev | Up | Next
goocanvas.PolylineModel | Home | goocanvas.TextModel