gtksourceviewmm 3.91.1
|
Gutter object for View. More...
#include <gtksourceviewmm/gutter.h>
Inherits Glib::Object.
Public Member Functions | |
Gutter (Gutter&& src) noexcept | |
Gutter& | operator= (Gutter&& src) noexcept |
~Gutter () noexcept override | |
GtkSourceGutter* | gobj () |
Provides access to the underlying C GObject. | |
const GtkSourceGutter* | gobj () const |
Provides access to the underlying C GObject. | |
GtkSourceGutter* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
void | insert (GutterRenderer* renderer, int position) |
Insert renderer into the gutter. | |
void | remove (GutterRenderer* renderer) |
Removes renderer from gutter. | |
void | reorder (GutterRenderer* renderer, int position) |
Reorders renderer in gutter to new position. | |
void | queue_draw () |
Invalidates the drawable area of the gutter. | |
GutterRenderer* | get_renderer_at_pos (int x, int y) |
Finds the Gtk::SourceGutterRenderer at (x, y). | |
const GutterRenderer* | get_renderer_at_pos (int x, int y) const |
Finds the Gtk::SourceGutterRenderer at (x, y). | |
Glib::PropertyProxy_ReadOnly< View* > | property_view () const |
Glib::PropertyProxy_ReadOnly< Gtk::TextWindowType > | property_window_type () const |
The gutters' text window type. | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gsv::Gutter > | wrap (GtkSourceGutter* object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
The Gutter object represents the left and right gutters of the text view. It is used by View to draw the line numbers and category marks that might be present on a line. By packing additional CellRenderer objects in the gutter, you can extend the gutter with your own custom drawings.
The gutter works very much the same way as cells rendered in a Gtk::TreeView. The concept is similar, with the exception that the gutter does not have an underlying Gtk::TreeModel. Instead, you should use set_cell_data_func() to set a callback to fill in any of the cell renderers properties, given the line for which the cell is to be rendered. Renderers are inserted into the gutter at a certain position. The builtin line number renderer is at position View::gutter_position_lines (-30) and the marks renderer is at View::gutter_position_marks (-20). You can use these values to position custom renderers accordingly. The width of a cell renderer can be specified as either fixed (using Gtk::CellRenderer::set_fixed_size()) or dynamic, in which case you must set set_cell_size_func(). This callback is used to set the properties of the renderer such that Gtk::CellRenderer::get_size() yields the maximum width of the cell.
|
noexcept |
|
overridenoexcept |
GutterRenderer* Gsv::Gutter::get_renderer_at_pos | ( | int | x, |
int | y ) |
Finds the Gtk::SourceGutterRenderer at (x, y).
x | The x position to get identified. |
y | The y position to get identified. |
nullptr
. const GutterRenderer* Gsv::Gutter::get_renderer_at_pos | ( | int | x, |
int | y ) const |
Finds the Gtk::SourceGutterRenderer at (x, y).
x | The x position to get identified. |
y | The y position to get identified. |
nullptr
.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GtkSourceGutter * Gsv::Gutter::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
void Gsv::Gutter::insert | ( | GutterRenderer* | renderer, |
int | position ) |
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.
renderer | A gutter renderer (must inherit from Gtk::SourceGutterRenderer). |
position | The renderer position. |
Glib::PropertyProxy_ReadOnly< View* > Gsv::Gutter::property_view | ( | ) | const |
Glib::PropertyProxy_ReadOnly< Gtk::TextWindowType > Gsv::Gutter::property_window_type | ( | ) | const |
The gutters' text window type.
Default value: Gtk::TEXT_WINDOW_PRIVATE
void Gsv::Gutter::queue_draw | ( | ) |
Invalidates the drawable area of the gutter.
You can use this to force a redraw of the gutter if something has changed and needs to be redrawn.
void Gsv::Gutter::remove | ( | GutterRenderer* | renderer | ) |
Removes renderer from gutter.
renderer | A Gtk::SourceGutterRenderer. |
void Gsv::Gutter::reorder | ( | GutterRenderer* | renderer, |
int | position ) |
Reorders renderer in gutter to new position.
renderer | A Gtk::CellRenderer. |
position | The new renderer position. |
|
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |