GtkSource.Gutter

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget GtkSource.Gutter GtkSource.Gutter Gtk.Widget->GtkSource.Gutter

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

get_view ()

insert (renderer, position)

remove (renderer)

reorder (renderer, position)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

view

GtkSource.View

r/w/co

window-type

Gtk.TextWindowType

r/w/co

The gutters’ text window type

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class GtkSource.Gutter(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

Structure:

GtkSource.GutterClass

Gutter object for [class`View`].

The GtkSourceGutter object represents the left or right gutter of the text view. It is used by [class`View`] to draw the line numbers and [class`Mark`]s that might be present on a line. By packing additional [class`GutterRenderer`] objects in the gutter, you can extend the gutter with your own custom drawings.

To get a GtkSourceGutter, use the [method`View`.get_gutter] function.

The gutter works very much the same way as cells rendered in a [class`Gtk`.TreeView]. The concept is similar, with the exception that the gutter does not have an underlying [iface`Gtk`.TreeModel]. The builtin line number renderer is at position GtkSource.ViewGutterPosition.LINES (-30) and the marks renderer is at GtkSource.ViewGutterPosition.MARKS (-20). The gutter sorts the renderers in ascending order, from left to right. So the marks are displayed on the right of the line numbers.

get_view()
Returns:

the associated GtkSource.View.

Return type:

GtkSource.View

insert(renderer, position)
Parameters:
Returns:

True if operation succeeded. Otherwise False.

Return type:

bool

Insert renderer into the gutter. If renderer is yet unowned then gutter claims its ownership. Otherwise just increases renderer’s reference count. renderer cannot be already inserted to another gutter.

remove(renderer)
Parameters:

renderer (GtkSource.GutterRenderer) –

reorder(renderer, position)
Parameters:

Reorders renderer in self to new position.

Property Details

GtkSource.Gutter.props.view
Name:

view

Type:

GtkSource.View

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The GtkSource.View of the gutter.

GtkSource.Gutter.props.window_type
Name:

window-type

Type:

Gtk.TextWindowType

Default Value:

Gtk.TextWindowType.LEFT

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The text window type on which the window is placed.