GooCanvasPolyline

GooCanvasPolyline — a polyline item (a series of lines with optional arrows).

Synopsis

struct              GooCanvasPolyline;
GooCanvasItem *     goo_canvas_polyline_new             (GooCanvasItem *parent,
                                                         gboolean close_path,
                                                         gint num_points,
                                                         ...);
GooCanvasItem *     goo_canvas_polyline_new_line        (GooCanvasItem *parent,
                                                         gdouble x1,
                                                         gdouble y1,
                                                         gdouble x2,
                                                         gdouble y2,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemSimple
         +----GooCanvasPolyline

Implemented Interfaces

GooCanvasPolyline implements GooCanvasItem.

Properties

  "arrow-length"             gdouble               : Read / Write
  "arrow-tip-length"         gdouble               : Read / Write
  "arrow-width"              gdouble               : Read / Write
  "close-path"               gboolean              : Read / Write
  "end-arrow"                gboolean              : Read / Write
  "height"                   gdouble               : Read / Write
  "points"                   GooCanvasPoints*      : Read / Write
  "start-arrow"              gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasPolyline represents a polyline item, which is a series of one or more lines, with optional arrows at either end.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

To create a GooCanvasPolyline use goo_canvas_polyline_new(), or goo_canvas_polyline_new_line() for a simple line between two points.

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

Details

struct GooCanvasPolyline

struct GooCanvasPolyline;

The GooCanvasPolyline struct contains private data only.


goo_canvas_polyline_new ()

GooCanvasItem *     goo_canvas_polyline_new             (GooCanvasItem *parent,
                                                         gboolean close_path,
                                                         gint num_points,
                                                         ...);

Creates a new polyline item.

parent :

the parent item, 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]

close_path :

if the last point should be connected to the first.

num_points :

the number of points in the polyline.

... :

the pairs of coordinates for each point in the line, followed by optional pairs of property names and values, and a terminating NULL.

Returns :

a new polyline item. [transfer full]

Here's an example showing how to create a filled triangle with vertices at (100,100), (300,100), and (200,300).

1
2
3
4
5
6
7
8
9
10
11