:right-sidebar: True GutterRenderer =================================================================== .. currentmodule:: gi.repository.GtkSource .. class:: GutterRenderer(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Subclasses: :class:`~gi.repository.GtkSource.GutterRendererPixbuf`, :class:`~gi.repository.GtkSource.GutterRendererText` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` :Constructors: :: GutterRenderer(**properties) Methods ------- .. rst-class:: interim-class .. class:: GutterRenderer :no-index: .. method:: activate(iter: ~gi.repository.Gtk.TextIter, area: ~gi.repository.Gdk.Rectangle, button: int, state: ~gi.repository.Gdk.ModifierType, n_presses: int) -> None Emits the :obj:`~gi.repository.GtkSource.GutterRenderer.signals.activate` signal of the renderer. This is called from :obj:`~gi.repository.GtkSource.Gutter` and should never have to be called manually. :param iter: a :obj:`~gi.repository.Gtk.TextIter` at the start of the line where the renderer is activated :param area: a :obj:`~gi.repository.Gdk.Rectangle` of the cell area where the renderer is activated :param button: the button that was pressed :param state: a :obj:`~gi.repository.Gdk.ModifierType` :param n_presses: the number of button presses .. method:: align_cell(line: int, width: float, height: float) -> tuple[float, float] Locates where to render content that is ``width`` x ``height`` based on the renderers alignment and padding. The location will be placed into ``x`` and ``y`` and is relative to the renderer's coordinates. It is encouraged that renderers use this function when snappshotting to ensure consistent placement of their contents. :param line: the line number for content :param width: the width of the content to draw :param height: the height of the content to draw .. method:: get_alignment_mode() -> ~gi.repository.GtkSource.GutterRendererAlignmentMode Get the alignment mode. The alignment mode describes the manner in which the renderer is aligned (see :obj:`~gi.repository.GtkSource.GutterRenderer.props.xalign` and :obj:`~gi.repository.GtkSource.GutterRenderer.props.yalign`). .. method:: get_buffer() -> ~gi.repository.GtkSource.Buffer | None Gets the :obj:`~gi.repository.GtkSource.Buffer` for which the gutter renderer is drawing. .. method:: get_view() -> ~gi.repository.GtkSource.View Get the view associated to the gutter renderer .. method:: get_xalign() -> float Gets the ``xalign`` property. This may be used to adjust where within the cell rectangle the renderer will draw. .. method:: get_xpad() -> int Gets the ``xpad`` property. This may be used to adjust the cell rectangle that the renderer will use to draw. .. method:: get_yalign() -> float Gets the ``yalign`` property. This may be used to adjust where within the cell rectangle the renderer will draw. .. method:: get_ypad() -> int Gets the ``ypad`` property. This may be used to adjust the cell rectangle that the renderer will use to draw. .. method:: query_activatable(iter: ~gi.repository.Gtk.TextIter, area: ~gi.repository.Gdk.Rectangle) -> bool Get whether the renderer is activatable at the location provided. This is called from :obj:`~gi.repository.GtkSource.Gutter` to determine whether a renderer is activatable using the mouse pointer. :param iter: a :obj:`~gi.repository.Gtk.TextIter` at the start of the line to be activated :param area: a :obj:`~gi.repository.Gdk.Rectangle` of the cell area to be activated .. method:: set_alignment_mode(mode: ~gi.repository.GtkSource.GutterRendererAlignmentMode) -> None Set the alignment mode. The alignment mode describes the manner in which the renderer is aligned (see :obj:`~gi.repository.GtkSource.GutterRenderer.props.xalign` and :obj:`~gi.repository.GtkSource.GutterRenderer.props.yalign`). :param mode: a :obj:`~gi.repository.GtkSource.GutterRendererAlignmentMode` .. method:: set_xalign(xalign: float) -> None Adjusts the ``xalign`` property. This may be used to adjust where within the cell rectangle the renderer will draw. :param xalign: the Y padding for the drawing cell .. method:: set_xpad(xpad: int) -> None Adjusts the ``xpad`` property. This may be used to adjust the cell rectangle that the renderer will use to draw. :param xpad: the Y padding for the drawing cell .. method:: set_yalign(yalign: float) -> None Adjusts the ``yalign`` property. This may be used to adjust where within the cell rectangle the renderer will draw. :param yalign: the Y padding for the drawing cell .. method:: set_ypad(ypad: int) -> None Adjusts the ``ypad`` property. This may be used to adjust the cell rectangle that the renderer will use to draw. :param ypad: the Y padding for the drawing cell Properties ---------- .. rst-class:: interim-class .. class:: GutterRenderer :no-index: .. attribute:: props.alignment_mode :type: ~gi.repository.GtkSource.GutterRendererAlignmentMode The alignment mode of the renderer. This can be used to indicate that in the case a cell spans multiple lines (due to text wrapping) the alignment should work on either the full cell, the first line or the last line. .. attribute:: props.lines :type: ~gi.repository.GtkSource.GutterLines Contains information about the lines to be rendered. It should be used by :obj:`~gi.repository.GtkSource.GutterRenderer` implementations from :obj:`~gi.repository.Gtk.Widget.snapshot`. .. attribute:: props.view :type: ~gi.repository.Gtk.TextView The view on which the renderer is placed. .. attribute:: props.xalign :type: float The horizontal alignment of the renderer. Set to 0 for a left alignment. 1 for a right alignment. And 0.5 for centering the cells. A value lower than 0 doesn't modify the alignment. .. attribute:: props.xpad :type: int The left and right padding of the renderer. .. attribute:: props.yalign :type: float The vertical alignment of the renderer. Set to 0 for a top alignment. 1 for a bottom alignment. And 0.5 for centering the cells. A value lower than 0 doesn't modify the alignment. .. attribute:: props.ypad :type: int The top and bottom padding of the renderer. Signals ------- .. rst-class:: interim-class .. class:: GutterRenderer.signals :no-index: .. method:: activate(iter: ~gi.repository.Gtk.TextIter, area: ~gi.repository.Gdk.Rectangle, button: int, state: ~gi.repository.Gdk.ModifierType, n_presses: int) -> None The signal is emitted when the renderer is activated. :param iter: a :obj:`~gi.repository.Gtk.TextIter` :param area: a :obj:`~gi.repository.Gdk.Rectangle` :param button: the button that was pressed :param state: a :obj:`~gi.repository.Gdk.ModifierType` of state :param n_presses: the number of button presses .. method:: query_activatable(iter: ~gi.repository.Gtk.TextIter, area: ~gi.repository.Gdk.Rectangle) -> bool The signal is emitted when the renderer can possibly be activated. :param iter: a :obj:`~gi.repository.Gtk.TextIter` :param area: a :obj:`~gi.repository.Gdk.Rectangle` .. method:: query_data(object: ~gi.repository.GObject.Object, p0: int) -> None :param object: :param p0: Virtual Methods --------------- .. rst-class:: interim-class .. class:: GutterRenderer :no-index: .. method:: do_activate(iter: ~gi.repository.Gtk.TextIter, area: ~gi.repository.Gdk.Rectangle, button: int, state: ~gi.repository.Gdk.ModifierType, n_presses: int) -> None Emits the :obj:`~gi.repository.GtkSource.GutterRenderer.signals.activate` signal of the renderer. This is called from :obj:`~gi.repository.GtkSource.Gutter` and should never have to be called manually. :param iter: a :obj:`~gi.repository.Gtk.TextIter` at the start of the line where the renderer is activated :param area: a :obj:`~gi.repository.Gdk.Rectangle` of the cell area where the renderer is activated :param button: the button that was pressed :param state: a :obj:`~gi.repository.Gdk.ModifierType` :param n_presses: the number of button presses .. method:: do_begin(lines: ~gi.repository.GtkSource.GutterLines) -> None :param lines: .. method:: do_change_buffer(old_buffer: ~gi.repository.GtkSource.Buffer | None = None) -> None This is called when the text buffer changes for ``renderer``. :param old_buffer: the old :obj:`~gi.repository.Gtk.TextBuffer`. .. method:: do_change_view(old_view: ~gi.repository.GtkSource.View | None = None) -> None This is called when the text view changes for ``renderer``. :param old_view: the old :obj:`~gi.repository.Gtk.TextView`. .. method:: do_end() -> None .. method:: do_query_activatable(iter: ~gi.repository.Gtk.TextIter, area: ~gi.repository.Gdk.Rectangle) -> bool Get whether the renderer is activatable at the location provided. This is called from :obj:`~gi.repository.GtkSource.Gutter` to determine whether a renderer is activatable using the mouse pointer. :param iter: a :obj:`~gi.repository.Gtk.TextIter` at the start of the line to be activated :param area: a :obj:`~gi.repository.Gdk.Rectangle` of the cell area to be activated .. method:: do_query_data(lines: ~gi.repository.GtkSource.GutterLines, line: int) -> None :param lines: :param line: .. method:: do_snapshot_line(snapshot: ~gi.repository.Gtk.Snapshot, lines: ~gi.repository.GtkSource.GutterLines, line: int) -> None :param snapshot: :param lines: :param line: Fields ------ .. rst-class:: interim-class .. class:: GutterRenderer :no-index: .. attribute:: parent_instance