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

## goocanvas.PolylineModel

goocanvas.PolylineModel — A model for polyline items (a series of lines with optional arrows).

## Synopsis

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

    Functions
        def goocanvas.polyline_model_new_line(parent, x1, y1, x2, y2, properties)

## Ancestry

    +-- gobject.GObject
    	+-- goocanvas.ItemModelModelSimple
    		+-- goocanvas.PolylineModel

## goocanvas.PolylineModel Properties

"arrow-length" | Read/Write | The length of the arrows, as a multiple of the line width. Allowed values: >= 0. Default value: 5.
"arrow-tip-length" | Read/Write | The length of the arrow tip, as a multiple of the line width. Allowed values: >= 0. Default value: 4.
"arrow-width" | Read/Write | The width of the arrows, as a multiple of the line width. Allowed values: >= 0. Default value: 4.
"close-path" | Read/Write | If the last point should be connected to the first. Default value: False.
"end-arrow" | Read/Write | If an arrow should be displayed at the end of the polyline. Default value: False.
"points" | Read/Write | The array of points.
"start-arrow" | Read/Write | If an arrow should be displayed at the start of the polyline. Default value: False.

## Implemented Interfaces

`goocanvas.PolylineModel` implements `goocanvas.ItemModel`

## Description

`goocanvas.PolylineModel` represents a model for polyline items, which is a series of one or more lines, with optional arrows at either end. 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.PolylineModel(properties=None)

`properties` : | A comma separated list of properties.
Returns : | A new `goocanvas.PolylineModel`

Creates a new canvas polyline item.

Here's an example showing how to create a filled triangle with vertices at (100,100), (300,100), and (200,300).

    	p_points = goocanvas.Points([(100.0, 100.0), (300.0, 100.0), (200.0, 300.0)])
    	polyline = goocanvas.PolylineModel(parent = root,
                                           points=p_points,
                                           close_path=True,
                                           stroke_color="red",
                                           fill_color="blue")

## Functions

### goocanvas.polyline_model_new_line

        def goocanvas.polyline_model_new_line(parent, x1, y1, x2, y2, properties)

`parent` : | The parent item, or None.
`x1` : | The x coordinate of the start of the line.
`y1` : | The y coordinate of the start of the line.
`x2` : | The x coordinate of the end of the line.
`y2` : | The y coordinate of the end of the line.
`properties` : | A comma separated list of properties.

Creates a new polyline model item with a single line.

Prev | Up | Next
goocanvas.PathModel | Home | goocanvas.RectModel