goocanvas.Grid
Prev | PyGooCanvas Standard Canvas Items Reference | Next

## goocanvas.Grid

goocanvas.Grid — A grid item.

## Synopsis

    class goocanvas.Grid(goocanvas.ItemSimple):
        goocanvas.Grid(properties=None)

## Ancestry

    +-- gobject.GObject
    	+-- goocanvas.ItemSimple
    		+-- goocanvas.Grid

## goocanvas.Grid Properties

"border_color" | Write | The color to use for the border. Default value: `None`.
"border-color-rgba" | Read/Write | The color to use for the border, specified as a 32-bit integer value. Default value: 0.
"border-pattern" | Read/Write | The cairo pattern to paint the border with.
"border-pixbuf" | Write | The pixbuf to use to draw the border.
"border-width" | Read/Write | The width of the border around the grid. Default value: -1.
"height" | Read/Write | The height of the grid. Allowed values: >= 0. Default value: 0.
"horz-grid-line-color" | Write | The color to use for the horizontal grid lines. Default value: `None`.
"horz-grid-line-color-rgba" | Read/Write | The color to use for the horizontal grid lines, specified as a 32-bit integer value. Default value: 0.
"horz-grid-line-pattern" | Read/Write | The cairo pattern to paint the horizontal grid lines with.
"horz-grid-line-pixbuf" | Write | The pixbuf to use to draw the horizontal grid lines.
"show-horz-grid-lines" | Read/Write | If the horizontal grid lines are shown. Default value: `True`.
"show-vert-grid-lines" | Read/Write | If the vertical grid lines are shown. Default value: `True`.
"horz-grid-line-width" | Read/Write | The width of the horizontal grid lines. Default value: -1.
"vert-grid-line-color" | Write | The color to use for the vertical grid lines. Default value: `None`.
"vert-grid-line-color-rgba" | Read/Write | The color to use for the vertical grid lines, specified as a 32-bit integer value. Default value: 0.
"vert-grid-line-pattern" | Read/Write | The cairo pattern to paint the vertical grid lines with.
"vert-grid-line-pixbuf" | Write | The pixbuf to use to draw the vertical grid lines.
"vert-grid-line-width" | Read/Write | The width of the vertical grid lines. Default value: -1.
"width" | Read/Write | The width of the grid. Allowed values: >= 0. Default value: 0.
"x" | Read/Write | The x coordinate of the grid. Default value: 0.
"x-offset" | Read/Write | The distance before the first vertical grid line. Allowed values: >= 0. Default value: 0.
"x-step" | Read/Write | The distance between the vertical grid lines. Allowed values: >= 0. Default value: 10.
"y" | Read/Write | The y coordinate of the grid. Default value: 0.
"y-offset" | Read/Write | The distance before the first horizontal grid line. Allowed values: >= 0. Default value: 0.
"y-step" | Read/Write | The distance between the horizontal grid lines. Allowed values: >= 0. Default value: 10.

## Implemented Interfaces

`goocanvas.Grid` implements `goocanvas.Item`

## Description

`goocanvas.Grid` represents a grid 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()`

## Constructor

        goocanvas.Grid(properties=None)

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

Creates a new canvas grid item.

Here's an example showing how to create a grid:

    grid = goocanvas.Grid(parent=root,
                                x=100,
                                y=100,
                                width=400,
                                height=200,
                                x_step=20,
                                Y_step=20,
                                x_offset=10,
                                y_offset=10,
                                horz_grid_line_width=4.0,
                                horz_grid_line_color="yellow",
                                vert_grid_line_width=2.0,
                                vert_grid_line_color="red",
                                border_width=3.0,
                                border_color="white",
                                fill_color="blue"
                                )

Prev | Up | Next
goocanvas.Ellipse | Home | goocanvas.Image