GtkSource.GutterRenderer¶
| Subclasses: | GtkSource.GutterRendererPixbuf,GtkSource.GutterRendererText | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| activate(iter, area, event) | |
| begin(cr, background_area, cell_area, start, end) | |
| draw(cr, background_area, cell_area, start, end, state) | |
| end() | |
| get_alignment() | |
| get_alignment_mode() | |
| get_background() | |
| get_padding() | |
| get_size() | |
| get_view() | |
| get_visible() | |
| get_window_type() | |
| query_activatable(iter, area, event) | |
| query_data(start, end, state) | |
| query_tooltip(iter, area, x, y, tooltip) | |
| queue_draw() | |
| set_alignment(xalign, yalign) | |
| set_alignment_mode(mode) | |
| set_background(color) | |
| set_padding(xpad, ypad) | |
| set_size(size) | |
| set_visible(visible) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
| do_activate(iter, area, event) | |
| do_begin(cr, background_area, cell_area, start, end) | |
| do_change_buffer(old_buffer) | |
| do_change_view(old_view) | |
| do_draw(cr, background_area, cell_area, start, end, state) | |
| do_end() | |
| do_query_activatable(iter, area, event) | |
| do_query_data(start, end, state) | |
| do_query_tooltip(iter, area, x, y, tooltip) | |
| do_queue_draw() | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| alignment-mode | GtkSource.GutterRendererAlignmentMode | r/w/c | The alignment mode | 
| background-rgba | Gdk.RGBA | r/w | The background color | 
| background-set | bool | r/w/c | Whether the background color is set | 
| size | int | r/w/c | The size | 
| view | Gtk.TextView | r | The view | 
| visible | bool | r/w/c | Visible | 
| window-type | Gtk.TextWindowType | r | The window type | 
| xalign | float | r/w/c | The x-alignment | 
| xpad | int | r/w/c | The x-padding | 
| yalign | float | r/w/c | The y-alignment | 
| ypad | int | r/w/c | The y-padding | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| activate | The ::activatesignal is emitted when the renderer is activated. | 
| query-activatable | The ::query-activatablesignal is emitted when the renderer can possibly be activated. | 
| query-data | The ::query-datasignal is emitted when the renderer needs to be filled with data just before a cell is drawn. | 
| query-tooltip | The ::query-tooltipsignal is emitted when the renderer can show a tooltip. | 
| queue-draw | The ::queue-drawsignal is emitted when the renderer needs to be redrawn. | 
Class Details¶
- 
class GtkSource.GutterRenderer(**kwargs)¶
- Bases: - GObject.InitiallyUnowned- Abstract: - Yes - Structure: - GtkSource.GutterRendererClass- 
activate(iter, area, event)¶
- Parameters: - iter (Gtk.TextIter) – aGtk.TextIterat the start of the line where the renderer is activated
- area (Gdk.Rectangle) – aGdk.Rectangleof the cell area where the renderer is activated
- event (Gdk.Event) – the event that triggered the activation
 - Emits the - GtkSource.GutterRenderer- ::activatesignal of the renderer. This is called from- GtkSource.Gutterand should never have to be called manually.
- iter (
 - 
begin(cr, background_area, cell_area, start, end)¶
- Parameters: - cr (cairo.Context) – acairo.Context
- background_area (Gdk.Rectangle) – aGdk.Rectangle
- cell_area (Gdk.Rectangle) – aGdk.Rectangle
- start (Gtk.TextIter) – aGtk.TextIter
- end (Gtk.TextIter) – aGtk.TextIter
 - Called when drawing a region begins. The region to be drawn is indicated by start and end. The purpose is to allow the implementation to precompute some state before the draw method is called for each cell. 
- cr (
 - 
draw(cr, background_area, cell_area, start, end, state)¶
- Parameters: - cr (cairo.Context) – the cairo render context
- background_area (Gdk.Rectangle) – aGdk.Rectangleindicating the total area to be drawn
- cell_area (Gdk.Rectangle) – aGdk.Rectangleindicating the area to draw content
- start (Gtk.TextIter) – aGtk.TextIter
- end (Gtk.TextIter) – aGtk.TextIter
- state (GtkSource.GutterRendererState) – aGtkSource.GutterRendererState
 - Main renderering method. Implementations should implement this method to draw onto the cairo context. The background_area indicates the total area of the cell to be drawn. The cell_area indicates the area where content can be drawn (text, images, etc). - The background_area is the cell_area plus the padding on each side (two times the - GtkSource.GutterRenderer- :xpadhorizontally and two times the- GtkSource.GutterRenderer- :ypadvertically, so that the cell_area is centered inside background_area).- The state argument indicates the current state of the renderer and should be taken into account to properly draw the different possible states (cursor, prelit, selected) if appropriate. 
- cr (
 - 
end()¶
- Called when drawing a region of lines has ended. 
 - 
get_alignment()¶
- Returns: - xalign: - return location for the x-alignment, or - Noneto ignore.- yalign: - return location for the y-alignment, or - Noneto ignore.- Return type: - (xalign: - float, yalign:- float)- Get the x-alignment and y-alignment of the gutter renderer. 
 - 
get_alignment_mode()¶
- Returns: - a - GtkSource.GutterRendererAlignmentMode- Return type: - GtkSource.GutterRendererAlignmentMode- Get the alignment mode. The alignment mode describes the manner in which the renderer is aligned (see - :xalignand- :yalign).
 - 
get_background()¶
- Returns: - Trueif the background color is set,- Falseotherwise- color: - return value for a - Gdk.RGBA- Return type: - ( - bool, color:- Gdk.RGBA)- Get the background color of the renderer. 
 - 
get_padding()¶
- Returns: - xpad: - return location for the x-padding, or - Noneto ignore.- ypad: - return location for the y-padding, or - Noneto ignore.- Return type: - (xpad: - int, ypad:- int)- Get the x-padding and y-padding of the gutter renderer. 
 - 
get_view()¶
- Returns: - a - Gtk.TextView- Return type: - Gtk.TextView- Get the view associated to the gutter renderer 
 - 
get_visible()¶
- Returns: - Trueif the renderer is visible,- Falseotherwise- Return type: - bool- Get whether the gutter renderer is visible. 
 - 
get_window_type()¶
- Returns: - a - Gtk.TextWindowType- Return type: - Gtk.TextWindowType- Get the - Gtk.TextWindowTypeassociated with the gutter renderer.
 - 
query_activatable(iter, area, event)¶
- Parameters: - iter (Gtk.TextIter) – aGtk.TextIterat the start of the line to be activated
- area (Gdk.Rectangle) – aGdk.Rectangleof the cell area to be activated
- event (Gdk.Event) – the event that triggered the query
 - Returns: - Return type: - Get whether the renderer is activatable at the location in event. This is called from - GtkSource.Gutterto determine whether a renderer is activatable using the mouse pointer.
- iter (
 - 
query_data(start, end, state)¶
- Parameters: - start (Gtk.TextIter) – aGtk.TextIter.
- end (Gtk.TextIter) – aGtk.TextIter.
- state (GtkSource.GutterRendererState) – aGtkSource.GutterRendererState.
 - Emit the - GtkSource.GutterRenderer- ::query-datasignal. This function is called to query for data just before rendering a cell. This is called from the- GtkSource.Gutter. Implementations can override the default signal handler or can connect a signal handler externally to the- GtkSource.GutterRenderer- ::query-datasignal.
- start (
 - 
query_tooltip(iter, area, x, y, tooltip)¶
- Parameters: - iter (Gtk.TextIter) – aGtk.TextIter.
- area (Gdk.Rectangle) – aGdk.Rectangle.
- x (int) – The x position of the tooltip.
- y (int) – The y position of the tooltip.
- tooltip (Gtk.Tooltip) – aGtk.Tooltip.
 - Returns: - Return type: - Emits the - GtkSource.GutterRenderer- ::query-tooltipsignal. This function is called from- GtkSource.Gutter. Implementations can override the default signal handler or can connect to the signal externally.
- iter (
 - 
queue_draw()¶
- Emits the - GtkSource.GutterRenderer- ::queue-drawsignal of the renderer. Call this from an implementation to inform that the renderer has changed such that it needs to redraw.
 - 
set_alignment(xalign, yalign)¶
- Parameters: - Set the alignment of the gutter renderer. Both xalign and yalign can be -1, which means the values will not be changed (this allows changing only one of the values). - xalign is the horizontal alignment. Set to 0 for a left alignment. 1 for a right alignment. And 0.5 for centering the cells. yalign is the vertical alignment. Set to 0 for a top alignment. 1 for a bottom alignment. 
 - 
set_alignment_mode(mode)¶
- Parameters: - mode ( - GtkSource.GutterRendererAlignmentMode) – a- GtkSource.GutterRendererAlignmentMode- Set the alignment mode. The alignment mode describes the manner in which the renderer is aligned (see - :xalignand- :yalign).
 - 
set_background(color)¶
- Parameters: - color ( - Gdk.RGBAor- None) – a- Gdk.RGBAor- None- Set the background color of the renderer. If color is set to - None, the renderer will not have a background color.
 - 
set_padding(xpad, ypad)¶
- Parameters: - Set the padding of the gutter renderer. Both xpad and ypad can be -1, which means the values will not be changed (this allows changing only one of the values). - xpad is the left and right padding. ypad is the top and bottom padding. 
 - 
set_size(size)¶
- Parameters: - size ( - int) – the size- Sets the size of the renderer. A value of -1 specifies that the size is to be determined dynamically. 
 - 
set_visible(visible)¶
- Parameters: - visible ( - bool) – the visibility- Set whether the gutter renderer is visible. 
 - 
do_activate(iter, area, event) virtual¶
- Parameters: - iter (Gtk.TextIter) – aGtk.TextIterat the start of the line where the renderer is activated
- area (Gdk.Rectangle) – aGdk.Rectangleof the cell area where the renderer is activated
- event (Gdk.Event) – the event that triggered the activation
 - Emits the - GtkSource.GutterRenderer- ::activatesignal of the renderer. This is called from- GtkSource.Gutterand should never have to be called manually.
- iter (
 - 
do_begin(cr, background_area, cell_area, start, end) virtual¶
- Parameters: - cr (cairo.Context) – acairo.Context
- background_area (Gdk.Rectangle) – aGdk.Rectangle
- cell_area (Gdk.Rectangle) – aGdk.Rectangle
- start (Gtk.TextIter) – aGtk.TextIter
- end (Gtk.TextIter) – aGtk.TextIter
 - Called when drawing a region begins. The region to be drawn is indicated by start and end. The purpose is to allow the implementation to precompute some state before the draw method is called for each cell. 
- cr (
 - 
do_change_buffer(old_buffer) virtual¶
- Parameters: - old_buffer ( - Gtk.TextBufferor- None) – the old- Gtk.TextBuffer.- This is called when the text buffer changes for renderer. 
 - 
do_change_view(old_view) virtual¶
- Parameters: - old_view ( - Gtk.TextViewor- None) – the old- Gtk.TextView.- This is called when the text view changes for renderer. 
 - 
do_draw(cr, background_area, cell_area, start, end, state) virtual¶
- Parameters: - cr (cairo.Context) – the cairo render context
- background_area (Gdk.Rectangle) – aGdk.Rectangleindicating the total area to be drawn
- cell_area (Gdk.Rectangle) – aGdk.Rectangleindicating the area to draw content
- start (Gtk.TextIter) – aGtk.TextIter
- end (Gtk.TextIter) – aGtk.TextIter
- state (GtkSource.GutterRendererState) – aGtkSource.GutterRendererState
 - Main renderering method. Implementations should implement this method to draw onto the cairo context. The background_area indicates the total area of the cell to be drawn. The cell_area indicates the area where content can be drawn (text, images, etc). - The background_area is the cell_area plus the padding on each side (two times the - GtkSource.GutterRenderer- :xpadhorizontally and two times the- GtkSource.GutterRenderer- :ypadvertically, so that the cell_area is centered inside background_area).- The state argument indicates the current state of the renderer and should be taken into account to properly draw the different possible states (cursor, prelit, selected) if appropriate. 
- cr (
 - 
do_end() virtual¶
- Called when drawing a region of lines has ended. 
 - 
do_query_activatable(iter, area, event) virtual¶
- Parameters: - iter (Gtk.TextIter) – aGtk.TextIterat the start of the line to be activated
- area (Gdk.Rectangle) – aGdk.Rectangleof the cell area to be activated
- event (Gdk.Event) – the event that triggered the query
 - Returns: - Return type: - Get whether the renderer is activatable at the location in event. This is called from - GtkSource.Gutterto determine whether a renderer is activatable using the mouse pointer.
- iter (
 - 
do_query_data(start, end, state) virtual¶
- Parameters: - start (Gtk.TextIter) – aGtk.TextIter.
- end (Gtk.TextIter) – aGtk.TextIter.
- state (GtkSource.GutterRendererState) – aGtkSource.GutterRendererState.
 - Emit the - GtkSource.GutterRenderer- ::query-datasignal. This function is called to query for data just before rendering a cell. This is called from the- GtkSource.Gutter. Implementations can override the default signal handler or can connect a signal handler externally to the- GtkSource.GutterRenderer- ::query-datasignal.
- start (
 - 
do_query_tooltip(iter, area, x, y, tooltip) virtual¶
- Parameters: - iter (Gtk.TextIter) – aGtk.TextIter.
- area (Gdk.Rectangle) – aGdk.Rectangle.
- x (int) – The x position of the tooltip.
- y (int) – The y position of the tooltip.
- tooltip (Gtk.Tooltip) – aGtk.Tooltip.
 - Returns: - Return type: - Emits the - GtkSource.GutterRenderer- ::query-tooltipsignal. This function is called from- GtkSource.Gutter. Implementations can override the default signal handler or can connect to the signal externally.
- iter (
 - 
do_queue_draw() virtual¶
- Emits the - GtkSource.GutterRenderer- ::queue-drawsignal of the renderer. Call this from an implementation to inform that the renderer has changed such that it needs to redraw.
 
- 
Signal Details¶
- 
GtkSource.GutterRenderer.signals.activate(gutter_renderer, iter, area, event)¶
- Signal Name: - activate- Flags: - Parameters: - gutter_renderer (GtkSource.GutterRenderer) – The object which received the signal
- iter (Gtk.TextIter) – aGtk.TextIter
- area (Gdk.Rectangle) – aGdk.Rectangle
- event (Gdk.Event) – the event that caused the activation
 - The - ::activatesignal is emitted when the renderer is activated.
- gutter_renderer (
- 
GtkSource.GutterRenderer.signals.query_activatable(gutter_renderer, iter, area, event)¶
- Signal Name: - query-activatable- Flags: - Parameters: - gutter_renderer (GtkSource.GutterRenderer) – The object which received the signal
- iter (Gtk.TextIter) – aGtk.TextIter
- area (Gdk.Rectangle) – aGdk.Rectangle
- event (Gdk.Event) – theGdk.Eventthat is causing the activatable query
 - Return type: - The - ::query-activatablesignal is emitted when the renderer can possibly be activated.
- gutter_renderer (
- 
GtkSource.GutterRenderer.signals.query_data(gutter_renderer, start, end, state)¶
- Signal Name: - query-data- Flags: - Parameters: - gutter_renderer (GtkSource.GutterRenderer) – The object which received the signal
- start (Gtk.TextIter) – aGtk.TextIter
- end (Gtk.TextIter) – aGtk.TextIter
- state (GtkSource.GutterRendererState) – the renderer state
 - The - ::query-datasignal is emitted when the renderer needs to be filled with data just before a cell is drawn. This can be used by general renderer implementations to allow render data to be filled in externally.
- gutter_renderer (
- 
GtkSource.GutterRenderer.signals.query_tooltip(gutter_renderer, iter, area, x, y, tooltip)¶
- Signal Name: - query-tooltip- Flags: - Parameters: - gutter_renderer (GtkSource.GutterRenderer) – The object which received the signal
- iter (Gtk.TextIter) – aGtk.TextIter
- area (Gdk.Rectangle) – aGdk.Rectangle
- x (int) – the x position (in window coordinates)
- y (int) – the y position (in window coordinates)
- tooltip (Gtk.Tooltip) – aGtk.Tooltip
 - Return type: - The - ::query-tooltipsignal is emitted when the renderer can show a tooltip.
- gutter_renderer (
- 
GtkSource.GutterRenderer.signals.queue_draw(gutter_renderer)¶
- Signal Name: - queue-draw- Flags: - RUN_LAST- Parameters: - gutter_renderer ( - GtkSource.GutterRenderer) – The object which received the signal- The - ::queue-drawsignal is emitted when the renderer needs to be redrawn. Use- GtkSource.GutterRenderer.queue_draw() to emit this signal from an implementation of the- GtkSource.GutterRendererinterface.
Property Details¶
- 
GtkSource.GutterRenderer.props.alignment_mode¶
- Name: - alignment-mode- Type: - GtkSource.GutterRendererAlignmentMode- Default Value: - GtkSource.GutterRendererAlignmentMode.CELL- Flags: - READABLE,- WRITABLE,- CONSTRUCT- 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. 
- 
GtkSource.GutterRenderer.props.background_rgba¶
- Name: - background-rgba- Type: - Gdk.RGBA- Default Value: - None- Flags: - READABLE,- WRITABLE- The background color 
- 
GtkSource.GutterRenderer.props.background_set¶
- Name: - background-set- Type: - bool- Default Value: - False- Flags: - READABLE,- WRITABLE,- CONSTRUCT- Whether the background color is set 
- 
GtkSource.GutterRenderer.props.size¶
- Name: - size- Type: - int- Default Value: - 0- Flags: - READABLE,- WRITABLE,- CONSTRUCT- The size 
- 
GtkSource.GutterRenderer.props.view¶
- Name: - view- Type: - Gtk.TextView- Default Value: - None- Flags: - READABLE- The view on which the renderer is placed. 
- 
GtkSource.GutterRenderer.props.visible¶
- Name: - visible- Type: - bool- Default Value: - True- Flags: - READABLE,- WRITABLE,- CONSTRUCT- The visibility of the renderer. 
- 
GtkSource.GutterRenderer.props.window_type¶
- Name: - window-type- Type: - Gtk.TextWindowType- Default Value: - Gtk.TextWindowType.PRIVATE- Flags: - READABLE- The window type of the view on which the renderer is placed (left, or right). 
- 
GtkSource.GutterRenderer.props.xalign¶
- Name: - xalign- Type: - float- Default Value: - 0.0- Flags: - READABLE,- WRITABLE,- CONSTRUCT- 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. 
- 
GtkSource.GutterRenderer.props.xpad¶
- Name: - xpad- Type: - int- Default Value: - 0- Flags: - READABLE,- WRITABLE,- CONSTRUCT- The left and right padding of the renderer.