Gutter#
Superclasses: Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
Gutter object for View
.
The GtkSourceGutter
object represents the left or right gutter of the text
view. It is used by View
to draw the line numbers and
Mark
s that might be present on a line. By packing
additional GutterRenderer
objects in the gutter, you can extend the
gutter with your own custom drawings.
To get a GtkSourceGutter
, use the get_gutter
function.
The gutter works very much the same way as cells rendered in a TreeView
.
The concept is similar, with the exception that the gutter does not have an
underlying TreeModel
. The builtin line number renderer is at position
LINES
(-30) and the marks renderer is at
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.
Methods#
- class Gutter
-
- insert(renderer: GutterRenderer, position: int) bool #
Insert
renderer
into the gutter. Ifrenderer
is yet unowned then gutter claims its ownership. Otherwise just increases renderer’s reference count.renderer
cannot be already inserted to another gutter.- Parameters:
renderer – a gutter renderer (must inherit from
GutterRenderer
).position – the renderer position.
- remove(renderer: GutterRenderer) None #
- Parameters:
renderer
- reorder(renderer: GutterRenderer, position: int) None #
Reorders
renderer
ingutter
to newposition
.- Parameters:
renderer – a
CellRenderer
.position – the new renderer position.
Properties#
- class Gutter
-
- props.window_type: TextWindowType#
The type of the None singleton.