goocanvas.GridModel

goocanvas.GridModel — A model for grid items.

Synopsis

class goocanvas.GridModel(goocanvas.ItemModelSimple):
    goocanvas.GridModel(properties=None)

Ancestry

+-- gobject.GObject
	+-- goocanvas.ItemModelSimple
		+-- goocanvas.GridModel

goocanvas.GridModel 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.
"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.GridModel implements goocanvas.ItemModel

Description

goocanvas.GridModel represents a model for grid items. It is a subclass of goocanvas.ItemModelSimple 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(). To respond to events such as mouse clicks on the ellipse you must connect to the signal handlers of the corresponding goocanvas.Grid objects. (See get_item and GooCanvas::item-created.)

Constructor

    goocanvas.GridModel(properties=None)

properties:

A comma separated list of properties.

Returns:

A new goocanvas.GridModel

Creates a new canvas grid model.

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

grid = goocanvas.GridModel(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"
                            )