PathLayer
Superclasses: Layer
, Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
A layer displaying line path between inserted Location
objects
This layer shows a connection between inserted objects implementing the
Location
interface. This means that both Marker
objects and Coordinate
objects can be inserted into the layer.
Of course, custom objects implementing the Location
interface
can be used as well.
Constructors
Methods
- class PathLayer
- add_node(location: Location) None
Adds a
Location
object to the layer. The node is prepended to the list.- Parameters:
location – a
Location
- get_nodes() list[Location]
Gets a copy of the list of all
Location
objects inserted into the layer. You should free the list but not its contents.
- insert_node(location: Location, position: int) None
Inserts a
Location
object to the specified position.
- remove_node(location: Location) None
Removes the
Location
object from the layer.- Parameters:
location – a
Location
- set_closed(value: bool) None
Makes the path closed.
- Parameters:
value –
True
to make the path closed
- set_dash(dash_pattern: list[int]) None
Sets dashed line pattern in a way similar to cairo_set_dash() of cairo. This method supports only integer values for segment lengths. The values have to be passed inside the data pointer of the list (using the
%GUINT_TO_POINTER
conversion)Pass
None
to use solid line.- Parameters:
dash_pattern – list of integer values representing lengths of dashes/spaces (see cairo documentation of cairo_set_dash())
- set_fill_color(color: RGBA | None = None) None
Set the path’s fill color.
- Parameters:
color – The path’s fill color or
None
to reset to the default color. The color parameter is copied.
- set_outline_color(color: RGBA | None = None) None
Set the path’s outline color.
- Parameters:
color – The path’s outline color or
None
to reset to the default color. The color parameter is copied.
- set_outline_width(value: float) None
Sets the width of the outline
- Parameters:
value – the width of the outline (in pixels)
- set_stroke(value: bool) None
Sets the path to be stroked
- Parameters:
value – if the path is stroked
Properties
- class PathLayer