GooCanvas.CanvasPoints

Fields

Name

Type

Access

Description

coords

float

r/w

the coordinates of the points, in pairs.

num_points

int

r/w

the number of points.

ref_count

int

r/w

the reference count of the struct.

Methods

class

new (num_points)

get_point (idx)

ref ()

set_point (idx, x, y)

unref ()

Details

class GooCanvas.CanvasPoints

#GooCairoPoints represents an array of points.

classmethod new(num_points)
Parameters:

num_points (int) – the number of points to create space for.

Returns:

a new GooCanvas.CanvasPoints struct.

Return type:

GooCanvas.CanvasPoints

Creates a new GooCanvas.CanvasPoints struct with space for the given number of points. It should be freed with GooCanvas.CanvasPoints.unref().

get_point(idx)
Parameters:

idx (int) – index of point to get.

Returns:

x:

location to store x coordinate.

y:

location to store y coordinate.

Return type:

(x: float, y: float)

Gets the coordinates of a point in the GooCanvas.CanvasPoints struct.

New in version 2.0.1.

ref()
Returns:

the GooCanvas.CanvasPoints struct.

Return type:

GooCanvas.CanvasPoints

Increments the reference count of the given GooCanvas.CanvasPoints struct.

set_point(idx, x, y)
Parameters:
  • idx (int) – index of point to set.

  • x (float) – x value to set point coordinate to.

  • y (float) – y value to set point coordinate to.

Sets the coordinates of a point in the GooCanvas.CanvasPoints struct.

New in version 2.0.1.

unref()

Decrements the reference count of the given GooCanvas.CanvasPoints struct, freeing it if the reference count falls to zero.