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