GutterRenderer
Superclasses: Widget
, InitiallyUnowned
, Object
Subclasses: GutterRendererPixbuf
, GutterRendererText
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
- Constructors:
GutterRenderer(**properties)
Methods
- class GutterRenderer
- activate(iter: TextIter, area: Rectangle, button: int, state: ModifierType, n_presses: int) None
Emits the
activate
signal of the renderer. This is called fromGutter
and should never have to be called manually.- Parameters:
iter – a
TextIter
at the start of the line where the renderer is activatedarea – a
Rectangle
of the cell area where the renderer is activatedbutton – the button that was pressed
state – a
ModifierType
n_presses – the number of button presses
- align_cell(line: int, width: float, height: float) tuple[float, float]
Locates where to render content that is
width
xheight
based on the renderers alignment and padding.The location will be placed into
x
andy
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.
- Parameters:
line – the line number for content
width – the width of the content to draw
height – the height of the content to draw
- get_alignment_mode() GutterRendererAlignmentMode
Get the alignment mode.
The alignment mode describes the manner in which the renderer is aligned (see
xalign
andyalign
).
- get_xalign() float
Gets the
xalign
property.This may be used to adjust where within the cell rectangle the renderer will draw.
- get_xpad() int
Gets the
xpad
property.This may be used to adjust the cell rectangle that the renderer will use to draw.
- get_yalign() float
Gets the
yalign
property.This may be used to adjust where within the cell rectangle the renderer will draw.
- get_ypad() int
Gets the
ypad
property.This may be used to adjust the cell rectangle that the renderer will use to draw.
- query_activatable(iter: TextIter, area: Rectangle) bool
Get whether the renderer is activatable at the location provided. This is called from
Gutter
to determine whether a renderer is activatable using the mouse pointer.
- set_alignment_mode(mode: GutterRendererAlignmentMode) None
Set the alignment mode. The alignment mode describes the manner in which the renderer is aligned (see
xalign
andyalign
).- Parameters:
mode – a
GutterRendererAlignmentMode
- set_xalign(xalign: float) None
Adjusts the
xalign
property.This may be used to adjust where within the cell rectangle the renderer will draw.
- Parameters:
xalign – the Y padding for the drawing cell
- 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.
- Parameters:
xpad – the Y padding for the drawing cell
Properties
- class GutterRenderer
- props.alignment_mode: 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.
- props.lines: GutterLines
Contains information about the lines to be rendered.
It should be used by
GutterRenderer
implementations fromsnapshot
.
- props.xalign: 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.
Signals
- class GutterRenderer.signals
- activate(iter: TextIter, area: Rectangle, button: int, state: ModifierType, n_presses: int) None
The signal is emitted when the renderer is activated.
- Parameters:
iter – a
TextIter
area – a
Rectangle
button – the button that was pressed
state – a
ModifierType
of staten_presses – the number of button presses
Virtual Methods
- class GutterRenderer
- do_activate(iter: TextIter, area: Rectangle, button: int, state: ModifierType, n_presses: int) None
Emits the
activate
signal of the renderer. This is called fromGutter
and should never have to be called manually.- Parameters:
iter – a
TextIter
at the start of the line where the renderer is activatedarea – a
Rectangle
of the cell area where the renderer is activatedbutton – the button that was pressed
state – a
ModifierType
n_presses – the number of button presses
- do_begin(lines: GutterLines) None
- Parameters:
lines
- do_change_buffer(old_buffer: Buffer | None = None) None
This is called when the text buffer changes for
renderer
.- Parameters:
old_buffer – the old
TextBuffer
.
- do_change_view(old_view: View | None = None) None
This is called when the text view changes for
renderer
.- Parameters:
old_view – the old
TextView
.
- do_query_activatable(iter: TextIter, area: Rectangle) bool
Get whether the renderer is activatable at the location provided. This is called from
Gutter
to determine whether a renderer is activatable using the mouse pointer.
- do_query_data(lines: GutterLines, line: int) None
- Parameters:
lines
line
- do_snapshot_line(snapshot: Snapshot, lines: GutterLines, line: int) None
- Parameters:
snapshot
lines
line
Fields
- class GutterRenderer
- parent_instance