GooCanvasGridModel

GooCanvasGridModel — a model for grid items.

Synopsis

struct              GooCanvasGridModel;
GooCanvasItemModel * goo_canvas_grid_model_new          (GooCanvasItemModel *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         gdouble x_step,
                                                         gdouble y_step,
                                                         gdouble x_offset,
                                                         gdouble y_offset,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasGridModel

Implemented Interfaces

GooCanvasGridModel implements GooCanvasItemModel.

Properties

  "border-color"             gchar*                : Write
  "border-color-gdk-rgba"    GdkRGBA*              : Read / Write
  "border-color-rgba"        guint                 : Read / Write
  "border-pattern"           GooCairoPattern*      : Read / Write
  "border-pixbuf"            GdkPixbuf*            : Write
  "border-width"             gdouble               : Read / Write
  "height"                   gdouble               : Read / Write
  "horz-grid-line-color"     gchar*                : Write
  "horz-grid-line-color-gdk-rgba" GdkRGBA*              : Read / Write
  "horz-grid-line-color-rgba" guint                 : Read / Write
  "horz-grid-line-pattern"   GooCairoPattern*      : Read / Write
  "horz-grid-line-pixbuf"    GdkPixbuf*            : Write
  "horz-grid-line-width"     gdouble               : Read / Write
  "show-horz-grid-lines"     gboolean              : Read / Write
  "show-vert-grid-lines"     gboolean              : Read / Write
  "vert-grid-line-color"     gchar*                : Write
  "vert-grid-line-color-gdk-rgba" GdkRGBA*              : Read / Write
  "vert-grid-line-color-rgba" guint                 : Read / Write
  "vert-grid-line-pattern"   GooCairoPattern*      : Read / Write
  "vert-grid-line-pixbuf"    GdkPixbuf*            : Write
  "vert-grid-line-width"     gdouble               : Read / Write
  "vert-grid-lines-on-top"   gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "x-offset"                 gdouble               : Read / Write
  "x-step"                   gdouble               : Read / Write
  "y"                        gdouble               : Read / Write
  "y-offset"                 gdouble               : Read / Write
  "y-step"                   gdouble               : Read / Write

Description

GooCanvasGridModel 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 GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

To create a GooCanvasGridModel use goo_canvas_grid_model_new().

To get or set the properties of an existing GooCanvasGridModel, 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 GooCanvasGrid objects. (See goo_canvas_get_item() and "item-created".)

The grid's position and size is specified with the "x", "y", "width" and "height" properties.

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

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

The width of the border can be set using the "border-width" property. The border is drawn outside the area specified with the "x", "y", "width" and "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 "stroke-color" and "line-width" properties, enabling different styles for horizontal and vertical grid lines.

Details

struct GooCanvasGridModel

struct GooCanvasGridModel;

The GooCanvasGridModel struct contains private data only.


goo_canvas_grid_model_new ()

GooCanvasItemModel * goo_canvas_grid_model_new          (GooCanvasItemModel *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         gdouble x_step,
                                                         gdouble y_step,
                                                         gdouble x_offset,
                                                         gdouble y_offset,
                                                         ...);

Creates a new grid model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. [skip]

x :

the x coordinate of the left of the grid.

y :

the y coordinate of the top of the grid.

width :

the width of the grid.

height :

the height of the grid.

x_step :

the distance between the vertical grid lines.

y_step :

the distance between the horizontal grid lines.

x_offset :

the distance before the first vertical grid line.

y_offset :

the distance before the first horizontal grid line.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new grid model. [transfer full]

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

1
2
3
4
5
6
7
8
9
10
11
12
13