## GtkSourceGutter

GtkSourceGutter — Gutter object for GtkSourceView

## Functions

GdkWindow * | gtk_source_gutter_get_window ()
gboolean | gtk_source_gutter_insert ()
void | gtk_source_gutter_reorder ()
void | gtk_source_gutter_remove ()
void | gtk_source_gutter_queue_draw ()
void | gtk_source_gutter_get_padding ()
void | gtk_source_gutter_set_padding ()
GtkSourceGutterRenderer * | gtk_source_gutter_get_renderer_at_pos ()

## Properties

GtkSourceView * | view | Read / Write / Construct Only
GtkTextWindowType | window-type | Read / Write / Construct Only
gint | xpad | Read / Write / Construct
gint | ypad | Read / Write / Construct

## Types and Values

| GtkSourceGutter

## Object Hierarchy

        GObject
        ╰── GtkSourceGutter

## 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_window ()

    GdkWindow *
    gtk_source_gutter_get_window (GtkSourceGutter *gutter);

`gtk_source_gutter_get_window` has been deprecated since version 3.12 and should not be used in newly-written code.

Use `gtk_text_view_get_window()` instead.

Get the GdkWindow of the gutter. The window will only be available when the gutter has at least one, non-zero width, cell renderer packed.

#### Parameters

gutter | a GtkSourceGutter. |

#### Returns

the GdkWindow of the gutter, or `NULL` if the gutter has no window.

[transfer none]

Since 2.8

### 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

### gtk_source_gutter_remove ()

    void
    gtk_source_gutter_remove (GtkSourceGutter *gutter,
                              GtkSourceGutterRenderer *renderer);

Removes `renderer` from `gutter` .

#### Parameters

gutter | a GtkSourceGutter. |
renderer | a GtkSourceGutterRenderer. |

Since 2.8

### gtk_source_gutter_queue_draw ()

    void
    gtk_source_gutter_queue_draw (GtkSourceGutter *gutter);

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.

#### Parameters

gutter | a GtkSourceGutter. |

Since 2.8

### gtk_source_gutter_get_padding ()

    void
    gtk_source_gutter_get_padding (GtkSourceGutter *gutter,
                                   gint *xpad,
                                   gint *ypad);

`gtk_source_gutter_get_padding` has been deprecated since version 3.12 and should not be used in newly-written code.

Use `gtk_source_gutter_renderer_get_padding()` instead.

### gtk_source_gutter_set_padding ()

    void
    gtk_source_gutter_set_padding (GtkSourceGutter *gutter,
                                   gint xpad,
                                   gint ypad);

`gtk_source_gutter_set_padding` has been deprecated since version 3.12 and should not be used in newly-written code.

Use `gtk_source_gutter_renderer_set_padding()` instead.

### gtk_source_gutter_get_renderer_at_pos ()

    GtkSourceGutterRenderer *
    gtk_source_gutter_get_renderer_at_pos (GtkSourceGutter *gutter,
                                           gint x,
                                           gint y);

Finds the GtkSourceGutterRenderer at (x, y).

#### Parameters

gutter | A GtkSourceGutter. |
x | The x position to get identified. |
y | The y position to get identified. |

#### Returns

the renderer at (x, y) or `NULL`.

[transfer none]

## Types and Values

### GtkSourceGutter

    typedef struct _GtkSourceGutter GtkSourceGutter;

## Property Details

### The `“view”` property

      “view”                     GtkSourceView *

The GtkSourceView of the gutter.

Flags: Read / Write / Construct Only

### The `“window-type”` property

      “window-type”              GtkTextWindowType

The text window type on which the window is placed.

Flags: Read / Write / Construct Only

Default value: GTK_TEXT_WINDOW_PRIVATE

### The `“xpad”` property

      “xpad”                     gint

The x-padding.

`GtkSourceGutter:xpad` has been deprecated since version 3.12 and should not be used in newly-written code.

Use the “xpad” property instead.

Flags: Read / Write / Construct

Allowed values: >= -1

Default value: 0

### The `“ypad”` property

      “ypad”                     gint

The y-padding.

`GtkSourceGutter:ypad` has been deprecated since version 3.12 and should not be used in newly-written code.

Use the “ypad” property instead.

Flags: Read / Write / Construct

Allowed values: >= -1

Default value: 0

## See Also

GtkSourceView, GtkSourceMark