GooCanvas.CanvasGridModel

g GObject.GInterface GObject.GInterface GooCanvas.CanvasItemModel GooCanvas.CanvasItemModel GObject.GInterface->GooCanvas.CanvasItemModel GObject.Object GObject.Object GooCanvas.CanvasItemModelSimple GooCanvas.CanvasItemModelSimple GObject.Object->GooCanvas.CanvasItemModelSimple GooCanvas.CanvasGridModel GooCanvas.CanvasGridModel GooCanvas.CanvasItemModel->GooCanvas.CanvasItemModelSimple GooCanvas.CanvasItemModelSimple->GooCanvas.CanvasGridModel

Subclasses:

None

Methods

Inherited:

GObject.Object (37), GooCanvas.CanvasItemModel (30)

Structs:

GObject.ObjectClass (5)

Virtual Methods

Inherited:

GObject.Object (7), GooCanvas.CanvasItemModel (19)

Properties

Inherited:

GooCanvas.CanvasItemModelSimple (23), GooCanvas.CanvasItemModel (9)

Name

Type

Flags

Short Description

border-color

str

w

The color to use for the border

border-color-gdk-rgba

Gdk.RGBA

r/w

The color to use for the border, specified as a Gdk.RGBA

border-color-rgba

int

r/w

The color to use for the border, specified as a 32-bit integer value

border-pattern

r/w

The cairo pattern to paint the border with

border-pixbuf

GdkPixbuf.Pixbuf

w

The pixbuf to use to draw the border

border-width

float

r/w

The width of the border around the grid

height

float

r/w

The height of the grid

horz-grid-line-color

str

w

The color to use for the horizontal grid lines

horz-grid-line-color-gdk-rgba

Gdk.RGBA

r/w

The color to use for the horizontal grid lines, specified as a Gdk.RGBA

horz-grid-line-color-rgba

int

r/w

The color to use for the horizontal grid lines, specified as a 32-bit integer value

horz-grid-line-pattern

r/w

The cairo pattern to paint the horizontal grid lines with

horz-grid-line-pixbuf

GdkPixbuf.Pixbuf

w

The pixbuf to use to draw the horizontal grid lines

horz-grid-line-width

float

r/w

The width of the horizontal grid lines

show-horz-grid-lines

bool

r/w

If the horizontal grid lines are shown

show-vert-grid-lines

bool

r/w

If the vertical grid lines are shown

vert-grid-line-color

str

w

The color to use for the vertical grid lines

vert-grid-line-color-gdk-rgba

Gdk.RGBA

r/w

The color to use for the vertical grid lines, specified as a Gdk.RGBA

vert-grid-line-color-rgba

int

r/w

The color to use for the vertical grid lines, specified as a 32-bit integer value

vert-grid-line-pattern

r/w

The cairo pattern to paint the vertical grid lines with

vert-grid-line-pixbuf

GdkPixbuf.Pixbuf

w

The pixbuf to use to draw the vertical grid lines

vert-grid-line-width

float

r/w

The width of the vertical grid lines

vert-grid-lines-on-top

bool

r/w

If the vertical grid lines are painted above the horizontal grid lines

width

float

r/w

The width of the grid

x

float

r/w

The x coordinate of the grid

x-offset

float

r/w

The distance before the first vertical grid line

x-step

float

r/w

The distance between the vertical grid lines

y

float

r/w

The y coordinate of the grid

y-offset

float

r/w

The distance before the first horizontal grid line

y-step

float

r/w

The distance between the horizontal grid lines

Signals

Inherited:

GObject.Object (1), GooCanvas.CanvasItemModel (6)

Fields

Inherited:

GObject.Object (1), GooCanvas.CanvasItemModel (6)

Name

Type

Access

Description

grid_data

GooCanvas.CanvasGridData

r

parent_object

GooCanvas.CanvasItemModelSimple

r

Class Details

class GooCanvas.CanvasGridModel(**kwargs)
Bases:

GooCanvas.CanvasItemModelSimple

Abstract:

No

Structure:

GooCanvas.CanvasGridModelClass

GooCanvas.CanvasGridModel represents a model for grid items. A grid consists of a number of equally-spaced horizontal and vertical grid lines, plus an optional border.

It is a subclass of GooCanvas.CanvasItemModelSimple and so inherits all of the style properties such as “stroke-color”, “fill-color” and “line-width”.

It also implements the GooCanvas.CanvasItemModel interface, so you can use the GooCanvas.CanvasItemModel functions such as GooCanvas.CanvasItemModel.raise_() and GooCanvas.CanvasItemModel.rotate().

To create a GooCanvas.CanvasGridModel use goo_canvas_grid_model_new().

To get or set the properties of an existing GooCanvas.CanvasGridModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the grid you must connect to the signal handlers of the corresponding GooCanvas.CanvasGrid objects. (See GooCanvas.Canvas.get_item() and GooCanvas.Canvas ::item-created.)

The grid’s position and size is specified with the GooCanvas.CanvasGridModel :x, GooCanvas.CanvasGridModel :y, GooCanvas.CanvasGridModel :width and GooCanvas.CanvasGridModel :height properties.

The GooCanvas.CanvasGridModel :x-step and GooCanvas.CanvasGridModel :y-step properties specify the distance between grid lines. The GooCanvas.CanvasGridModel :x-offset and GooCanvas.CanvasGridModel :y-offset properties specify the distance before the first grid lines.

The horizontal or vertical grid lines can be hidden using the GooCanvas.CanvasGridModel :show-horz-grid-lines and GooCanvas.CanvasGridModel :show-vert-grid-lines properties.

The width of the border can be set using the GooCanvas.CanvasGridModel :border-width property. The border is drawn outside the area specified with the GooCanvas.CanvasGridModel :x, GooCanvas.CanvasGridModel :y, GooCanvas.CanvasGridModel :width and GooCanvas.CanvasGridModel :height properties.

Other properties allow the colors and widths of the grid lines to be set. The grid line color and width properties override the standard GooCanvas.CanvasItemModelSimple :stroke-color and GooCanvas.CanvasItemModelSimple :line-width properties, enabling different styles for horizontal and vertical grid lines.

Property Details

GooCanvas.CanvasGridModel.props.border_color
Name:

border-color

Type:

str

Default Value:

None

Flags:

WRITABLE

The color to use for the border

GooCanvas.CanvasGridModel.props.border_color_gdk_rgba
Name:

border-color-gdk-rgba

Type:

Gdk.RGBA

Default Value:

None

Flags:

READABLE, WRITABLE

The color to use for the border, specified as a Gdk.RGBA

GooCanvas.CanvasGridModel.props.border_color_rgba
Name:

border-color-rgba

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The color to use for the border, specified as a 32-bit integer value

GooCanvas.CanvasGridModel.props.border_pattern
Name:

border-pattern

Type:

Default Value:

None

Flags:

READABLE, WRITABLE

The cairo pattern to paint the border with

GooCanvas.CanvasGridModel.props.border_pixbuf
Name:

border-pixbuf

Type:

GdkPixbuf.Pixbuf

Default Value:

None

Flags:

WRITABLE

The pixbuf to use to draw the border

GooCanvas.CanvasGridModel.props.border_width
Name:

border-width

Type:

float

Default Value:

-1.0

Flags:

READABLE, WRITABLE

The width of the border around the grid

GooCanvas.CanvasGridModel.props.height
Name:

height

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The height of the grid

GooCanvas.CanvasGridModel.props.horz_grid_line_color
Name:

horz-grid-line-color

Type:

str

Default Value:

None

Flags:

WRITABLE

The color to use for the horizontal grid lines

GooCanvas.CanvasGridModel.props.horz_grid_line_color_gdk_rgba
Name:

horz-grid-line-color-gdk-rgba

Type:

Gdk.RGBA

Default Value:

None

Flags:

READABLE, WRITABLE

The color to use for the horizontal grid lines, specified as a Gdk.RGBA

GooCanvas.CanvasGridModel.props.horz_grid_line_color_rgba
Name:

horz-grid-line-color-rgba

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The color to use for the horizontal grid lines, specified as a 32-bit integer value

GooCanvas.CanvasGridModel.props.horz_grid_line_pattern
Name:

horz-grid-line-pattern

Type:

Default Value:

None

Flags:

READABLE, WRITABLE

The cairo pattern to paint the horizontal grid lines with

GooCanvas.CanvasGridModel.props.horz_grid_line_pixbuf
Name:

horz-grid-line-pixbuf

Type:

GdkPixbuf.Pixbuf

Default Value:

None

Flags:

WRITABLE

The pixbuf to use to draw the horizontal grid lines

GooCanvas.CanvasGridModel.props.horz_grid_line_width
Name:

horz-grid-line-width

Type:

float

Default Value:

-1.0

Flags:

READABLE, WRITABLE

The width of the horizontal grid lines

GooCanvas.CanvasGridModel.props.show_horz_grid_lines
Name:

show-horz-grid-lines

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

If the horizontal grid lines are shown

GooCanvas.CanvasGridModel.props.show_vert_grid_lines
Name:

show-vert-grid-lines

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

If the vertical grid lines are shown

GooCanvas.CanvasGridModel.props.vert_grid_line_color
Name:

vert-grid-line-color

Type:

str

Default Value:

None

Flags:

WRITABLE

The color to use for the vertical grid lines

GooCanvas.CanvasGridModel.props.vert_grid_line_color_gdk_rgba
Name:

vert-grid-line-color-gdk-rgba

Type:

Gdk.RGBA

Default Value:

None

Flags:

READABLE, WRITABLE

The color to use for the vertical grid lines, specified as a Gdk.RGBA

GooCanvas.CanvasGridModel.props.vert_grid_line_color_rgba
Name:

vert-grid-line-color-rgba

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The color to use for the vertical grid lines, specified as a 32-bit integer value

GooCanvas.CanvasGridModel.props.vert_grid_line_pattern
Name:

vert-grid-line-pattern

Type:

Default Value:

None

Flags:

READABLE, WRITABLE

The cairo pattern to paint the vertical grid lines with

GooCanvas.CanvasGridModel.props.vert_grid_line_pixbuf
Name:

vert-grid-line-pixbuf

Type:

GdkPixbuf.Pixbuf

Default Value:

None

Flags:

WRITABLE

The pixbuf to use to draw the vertical grid lines

GooCanvas.CanvasGridModel.props.vert_grid_line_width
Name:

vert-grid-line-width

Type:

float

Default Value:

-1.0

Flags:

READABLE, WRITABLE

The width of the vertical grid lines

GooCanvas.CanvasGridModel.props.vert_grid_lines_on_top
Name:

vert-grid-lines-on-top

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

If the vertical grid lines are painted above the horizontal grid lines

GooCanvas.CanvasGridModel.props.width
Name:

width

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The width of the grid

GooCanvas.CanvasGridModel.props.x
Name:

x

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The x coordinate of the grid

GooCanvas.CanvasGridModel.props.x_offset
Name:

x-offset

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The distance before the first vertical grid line

GooCanvas.CanvasGridModel.props.x_step
Name:

x-step

Type:

float

Default Value:

10.0

Flags:

READABLE, WRITABLE

The distance between the vertical grid lines

GooCanvas.CanvasGridModel.props.y
Name:

y

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The y coordinate of the grid

GooCanvas.CanvasGridModel.props.y_offset
Name:

y-offset

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

The distance before the first horizontal grid line

GooCanvas.CanvasGridModel.props.y_step
Name:

y-step

Type:

float

Default Value:

10.0

Flags:

READABLE, WRITABLE

The distance between the horizontal grid lines