GtkSource.Region

g GObject.Object GObject.Object GtkSource.Region GtkSource.Region GObject.Object->GtkSource.Region

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (buffer)

add_region (region_to_add)

add_subregion (_start, _end)

get_bounds ()

get_buffer ()

get_start_region_iter ()

intersect_region (region2)

intersect_subregion (_start, _end)

is_empty ()

subtract_region (region_to_subtract)

subtract_subregion (_start, _end)

to_string ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

buffer

Gtk.TextBuffer

r/w/co

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class GtkSource.Region(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GtkSource.RegionClass

classmethod new(buffer)
Parameters:

buffer (Gtk.TextBuffer) – a Gtk.TextBuffer.

Returns:

a new GtkSource.Region object for buffer.

Return type:

GtkSource.Region

New in version 3.22.

add_region(region_to_add)
Parameters:

region_to_add (GtkSource.Region or None) – the GtkSource.Region to add to self, or None.

Adds region_to_add to self. region_to_add is not modified.

New in version 3.22.

add_subregion(_start, _end)
Parameters:

Adds the subregion delimited by _start and _end to self.

New in version 3.22.

get_bounds()
Returns:

True if start and end have been set successfully (if non-None), or False if the self is empty.

start:

iterator to initialize with the start of self, or None.

end:

iterator to initialize with the end of self, or None.

Return type:

(bool, start: Gtk.TextIter, end: Gtk.TextIter)

Gets the start and end bounds of the self.

New in version 3.22.

get_buffer()
Returns:

the Gtk.TextBuffer.

Return type:

Gtk.TextBuffer or None

New in version 3.22.

get_start_region_iter()
Returns:

iterator to initialize to the first subregion.

Return type:

iter: GtkSource.RegionIter

Initializes a GtkSource.RegionIter to the first subregion of self. If self is empty, iter will be initialized to the end iterator.

New in version 3.22.

intersect_region(region2)
Parameters:

region2 (GtkSource.Region or None) – a GtkSource.Region, or None.

Returns:

the intersection as a GtkSource.Region object.

Return type:

GtkSource.Region or None

Returns the intersection between self and region2. self and region2 are not modified.

New in version 3.22.

intersect_subregion(_start, _end)
Parameters:
Returns:

the intersection as a new GtkSource.Region.

Return type:

GtkSource.Region or None

Returns the intersection between self and the subregion delimited by _start and _end. self is not modified.

New in version 3.22.

is_empty()
Returns:

whether the self is empty.

Return type:

bool

Returns whether the self is empty. A None self is considered empty.

New in version 3.22.

subtract_region(region_to_subtract)
Parameters:

region_to_subtract (GtkSource.Region or None) – the GtkSource.Region to subtract from self, or None.

Subtracts region_to_subtract from self. region_to_subtract is not modified.

New in version 3.22.

subtract_subregion(_start, _end)
Parameters:

Subtracts the subregion delimited by _start and _end from self.

New in version 3.22.

to_string()
Returns:

a string represention of self. Free with GLib.free() when no longer needed.

Return type:

str or None

Gets a string represention of self, for debugging purposes.

The returned string contains the character offsets of the subregions. It doesn’t include a newline character at the end of the string.

New in version 3.22.

Property Details

GtkSource.Region.props.buffer
Name:

buffer

Type:

Gtk.TextBuffer

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Gtk.TextBuffer. The GtkSource.Region has a weak reference to the buffer.

New in version 3.22.