SpaceDrawer
Superclasses: Object
- Constructors:
SpaceDrawer(**properties)
new() -> GtkSource.SpaceDrawer
Constructors
- class SpaceDrawer
- classmethod new() SpaceDrawer
Creates a new
SpaceDrawer
object.Useful for storing space drawing settings independently of a
View
.
Methods
- class SpaceDrawer
- bind_matrix_setting(settings: Settings, key: str, flags: SettingsBindFlags) None
Binds the
matrix
property to aSettings
key.The
Settings
key must be of the same type as thematrix
property, that is,"au"
.The
bind
function cannot be used, because the default GIO mapping functions don’t supportVariant
properties (maybe it will be supported by a future GIO version, in which case this function can be deprecated).- Parameters:
settings – a
Settings
object.key – the
settings
key to bind.flags – flags for the binding.
- get_matrix() Variant
Gets the value of the
matrix
property, as aVariant
.An empty array can be returned in case the matrix is a zero matrix.
The
get_types_for_locations
function may be more convenient to use.
- get_types_for_locations(locations: SpaceLocationFlags) SpaceTypeFlags
If only one location is specified, this function returns what kind of white spaces are drawn at that location.
The value is retrieved from the
matrix
property.If several locations are specified, this function returns the logical AND for those locations. Which means that if a certain kind of white space is present in the return value, then that kind of white space is drawn at all the specified
locations
.- Parameters:
locations – one or several
SpaceLocationFlags
.
- set_enable_matrix(enable_matrix: bool) None
Sets whether the
matrix
property is enabled.- Parameters:
enable_matrix – the new value.
- set_matrix(matrix: Variant | None = None) None
Sets a new value to the
matrix
property, as aVariant
.If
matrix
isNone
, then an empty array is set.If
matrix
is floating, it is consumed.The
set_types_for_locations
function may be more convenient to use.- Parameters:
matrix – the new matrix value, or
None
.
- set_types_for_locations(locations: SpaceLocationFlags, types: SpaceTypeFlags) None
Modifies the
matrix
property at the specifiedlocations
.- Parameters:
locations – one or several
SpaceLocationFlags
.types – a combination of
SpaceTypeFlags
.
Properties
- class SpaceDrawer
-
- props.matrix: Variant
The property is a
Variant
property to specify where and what kind of white spaces to draw.The
Variant
is of type"au"
, an array of unsigned integers. Each integer is a combination ofSpaceTypeFlags
. There is one integer for eachSpaceLocationFlags
, in the same order as they are defined in the enum (NONE
andALL
are not taken into account).If the array is shorter than the number of locations, then the value for the missing locations will be
NONE
.By default,
ALL
is set for all locations.4