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.SpaceDrawerobject. 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.Settingsobject.key (
str) – the settings key to bind.flags (
Gio.SettingsBindFlags) – flags for the binding.
Binds the
GtkSource.SpaceDrawer:matrixproperty to aGio.Settingskey.The
Gio.Settingskey must be of the same type as theGtkSource.SpaceDrawer:matrixproperty, that is,"au".The
Gio.Settings.bind() function cannot be used, because the default GIO mapping functions don’t supportGLib.Variantproperties (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:matrixproperty is enabled.- Return type:
 
New in version 3.24.
- get_matrix()¶
 - Returns:
 the
GtkSource.SpaceDrawer:matrixvalue as a new floatingGLib.Variantinstance.- Return type:
 
Gets the value of the
GtkSource.SpaceDrawer:matrixproperty, 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:matrixproperty.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:matrixproperty is enabled.New in version 3.24.
- set_matrix(matrix)¶
 - Parameters:
 matrix (
GLib.VariantorNone) – the new matrix value, orNone.
Sets a new value to the
GtkSource.SpaceDrawer:matrixproperty, 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:matrixproperty at the specified locations.New in version 3.24.
Property Details¶
- GtkSource.SpaceDrawer.props.enable_matrix¶
 - 
Whether the
GtkSource.SpaceDrawer:matrixproperty is enabled.New in version 3.24.
 
- GtkSource.SpaceDrawer.props.matrix¶
 - Name:
 matrix- Type:
 - Default Value:
 GLib.Variant('au', [15, 15, 15])- Flags:
 
The
:matrixproperty is aGLib.Variantproperty to specify where and what kind of white spaces to draw.The
GLib.Variantis 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.NONEandGtkSource.SpaceLocationFlags.ALLare 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.ALLis set for all locations.New in version 3.24.