:right-sidebar: True Gutter =================================================================== .. currentmodule:: gi.repository.GtkSource .. class:: Gutter(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` Gutter object for :obj:`~gi.repository.GtkSource.View`\. The ``GtkSourceGutter`` object represents the left or right gutter of the text view. It is used by :obj:`~gi.repository.GtkSource.View` to draw the line numbers and :obj:`~gi.repository.GtkSource.Mark`\s that might be present on a line. By packing additional :obj:`~gi.repository.GtkSource.GutterRenderer` objects in the gutter, you can extend the gutter with your own custom drawings. To get a ``GtkSourceGutter``\, use the :obj:`~gi.repository.View.get_gutter` function. The gutter works very much the same way as cells rendered in a :obj:`~gi.repository.Gtk.TreeView`\. The concept is similar, with the exception that the gutter does not have an underlying :obj:`~gi.repository.Gtk.TreeModel`\. The builtin line number renderer is at position :const:`~gi.repository.GtkSource.ViewGutterPosition.LINES` (-30) and the marks renderer is at :const:`~gi.repository.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. Methods ------- .. rst-class:: interim-class .. class:: Gutter :no-index: .. method:: get_view() -> ~gi.repository.GtkSource.View .. method:: insert(renderer: ~gi.repository.GtkSource.GutterRenderer, position: int) -> 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. :param renderer: a gutter renderer (must inherit from :obj:`~gi.repository.GtkSource.GutterRenderer`\). :param position: the renderer position. .. method:: remove(renderer: ~gi.repository.GtkSource.GutterRenderer) -> None :param renderer: .. method:: reorder(renderer: ~gi.repository.GtkSource.GutterRenderer, position: int) -> None Reorders ``renderer`` in ``gutter`` to new ``position``\. :param renderer: a :obj:`~gi.repository.Gtk.CellRenderer`\. :param position: the new renderer position. Properties ---------- .. rst-class:: interim-class .. class:: Gutter :no-index: .. attribute:: props.view :type: ~gi.repository.GtkSource.View The type of the None singleton. .. attribute:: props.window_type :type: ~gi.repository.Gtk.TextWindowType The type of the None singleton.