GtkSource.SpaceDrawer¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/c |
|||
r/w/c |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GtkSource.SpaceDrawer(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
a new
GtkSource.SpaceDrawer
.- Return type:
Creates a new
GtkSource.SpaceDrawer
object. Useful for storing space drawing settings independently of aGtkSource.View
.New in version 3.24.
- bind_matrix_setting(settings, key, flags)¶
- Parameters:
settings (
Gio.Settings
) – aGio.Settings
object.key (
str
) – the settings key to bind.flags (
Gio.SettingsBindFlags
) – flags for the binding.
Binds the
GtkSource.SpaceDrawer
:matrix
property to aGio.Settings
key.The
Gio.Settings
key must be of the same type as theGtkSource.SpaceDrawer
:matrix
property, that is,"au"
.The
Gio.Settings.bind
() function cannot be used, because the default GIO mapping functions don’t supportGLib.Variant
properties (maybe it will be supported by a future GIO version, in which case this function can be deprecated).New in version 3.24.
- get_enable_matrix()¶
- Returns:
whether the
GtkSource.SpaceDrawer
:matrix
property is enabled.- Return type:
New in version 3.24.
- get_matrix()¶
- Returns:
the
GtkSource.SpaceDrawer
:matrix
value as a new floatingGLib.Variant
instance.- Return type:
Gets the value of the
GtkSource.SpaceDrawer
:matrix
property, as aGLib.Variant
. An empty array can be returned in case the matrix is a zero matrix.The
GtkSource.SpaceDrawer.get_types_for_locations
() function may be more convenient to use.New in version 3.24.
- get_types_for_locations(locations)¶
- Parameters:
locations (
GtkSource.SpaceLocationFlags
) – one or severalGtkSource.SpaceLocationFlags
.- Returns:
a combination of
GtkSource.SpaceTypeFlags
.- Return type:
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
GtkSource.SpaceDrawer
: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.
New in version 3.24.
- set_enable_matrix(enable_matrix)¶
- Parameters:
enable_matrix (
bool
) – the new value.
Sets whether the
GtkSource.SpaceDrawer
:matrix
property is enabled.New in version 3.24.
- set_matrix(matrix)¶
- Parameters:
matrix (
GLib.Variant
orNone
) – the new matrix value, orNone
.
Sets a new value to the
GtkSource.SpaceDrawer
:matrix
property, as aGLib.Variant
. If matrix isNone
, then an empty array is set.If matrix is floating, it is consumed.
The
GtkSource.SpaceDrawer.set_types_for_locations
() function may be more convenient to use.New in version 3.24.
- set_types_for_locations(locations, types)¶
- Parameters:
locations (
GtkSource.SpaceLocationFlags
) – one or severalGtkSource.SpaceLocationFlags
.types (
GtkSource.SpaceTypeFlags
) – a combination ofGtkSource.SpaceTypeFlags
.
Modifies the
GtkSource.SpaceDrawer
:matrix
property at the specified locations.New in version 3.24.
Property Details¶
- GtkSource.SpaceDrawer.props.enable_matrix¶
-
Whether the
GtkSource.SpaceDrawer
:matrix
property is enabled.New in version 3.24.
- GtkSource.SpaceDrawer.props.matrix¶
- Name:
matrix
- Type:
- Default Value:
GLib.Variant('au', [15, 15, 15])
- Flags:
The
:matrix
property is aGLib.Variant
property to specify where and what kind of white spaces to draw.The
GLib.Variant
is of type"au"
, an array of unsigned integers. Each integer is a combination ofGtkSource.SpaceTypeFlags
. There is one integer for eachGtkSource.SpaceLocationFlags
, in the same order as they are defined in the enum (GtkSource.SpaceLocationFlags.NONE
andGtkSource.SpaceLocationFlags.ALL
are not taken into account).If the array is shorter than the number of locations, then the value for the missing locations will be
GtkSource.SpaceTypeFlags.NONE
.By default,
GtkSource.SpaceTypeFlags.ALL
is set for all locations.New in version 3.24.