GtkSourceGutter

GtkSourceGutter — Gutter object for GtkSourceView

Functions

Properties

GtkSourceView * view Read / Write / Construct Only
GtkTextWindowType window-type Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkSourceGutter

Implemented Interfaces

GtkSourceGutter implements GtkAccessible, GtkBuildable and GtkConstraintTarget.

Includes

#include <gtksourceview/gtksource.h>

Description

The GtkSourceGutter object represents the left or right gutter of the text view. It is used by GtkSourceView to draw the line numbers and GtkSourceMarks that might be present on a line. By packing additional GtkSourceGutterRenderer objects in the gutter, you can extend the gutter with your own custom drawings.

To get a GtkSourceGutter, use the gtk_source_view_get_gutter() function.

The gutter works very much the same way as cells rendered in a GtkTreeView. The concept is similar, with the exception that the gutter does not have an underlying GtkTreeModel. The builtin line number renderer is at position GTK_SOURCE_VIEW_GUTTER_POSITION_LINES (-30) and the marks renderer is at GTK_SOURCE_VIEW_GUTTER_POSITION_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.

Functions

gtk_source_gutter_get_view ()

GtkSourceView *
gtk_source_gutter_get_view (GtkSourceGutter *gutter);

Parameters

gutter

a GtkSourceGutter.

 

Returns

the associated GtkSourceView.

[transfer none]

Since: 3.24


gtk_source_gutter_insert ()

gboolean
gtk_source_gutter_insert (GtkSourceGutter *gutter,
                          GtkSourceGutterRenderer *renderer,
                          gint 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.

Parameters

gutter

a GtkSourceGutter.

 

renderer

a gutter renderer (must inherit from GtkSourceGutterRenderer).

 

position

the renderer position.

 

Returns

TRUE if operation succeeded. Otherwise FALSE.

Since: 3.0


gtk_source_gutter_reorder ()

void
gtk_source_gutter_reorder (GtkSourceGutter *gutter,
                           GtkSourceGutterRenderer *renderer,
                           gint position);

Reorders renderer in gutter to new position .

Parameters

gutter

a GtkSourceGutterRenderer.

 

renderer

a GtkCellRenderer.

 

position

the new renderer position.

 

Since: 2.8

Types and Values

GtkSourceGutter

typedef struct _GtkSourceGutter GtkSourceGutter;

Property Details

The “view” property

  “view”                     GtkSourceView *

The GtkSourceView of the gutter.

Owner: GtkSourceGutter

Flags: Read / Write / Construct Only


The “window-type” property

  “window-type”              GtkTextWindowType

The text window type on which the window is placed.

Owner: GtkSourceGutter

Flags: Read / Write / Construct Only

Default value: GTK_TEXT_WINDOW_LEFT

See Also

GtkSourceView, GtkSourceMark