GtkSourceMap: GtkSourceView 4 Reference Manual

## GtkSourceMap GtkSourceMap — Widget that displays a map for a specific GtkSourceView |

## Functions

GtkWidget * | gtk_source_map_new ()
void | gtk_source_map_set_view ()
GtkSourceView * | gtk_source_map_get_view ()

## Properties

PangoFontDescription * | font-desc | Read / Write
GtkSourceView * | view | Read / Write

## Types and Values

| GtkSourceMap

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkTextView
                        ╰── GtkSourceView
                            ╰── GtkSourceMap

## Implemented Interfaces

GtkSourceMap implements AtkImplementorIface, GtkBuildable and GtkScrollable.

## Includes

    #include <gtksourceview/gtksource.h>

## Description

GtkSourceMap is a widget that maps the content of a GtkSourceView into a smaller view so the user can have a quick overview of the whole document.

This works by connecting a GtkSourceView to to the GtkSourceMap using the “view” property or `gtk_source_map_set_view()`.

GtkSourceMap is a GtkSourceView object. This means that you can add a GtkSourceGutterRenderer to a gutter in the same way you would for a GtkSourceView. One example might be a GtkSourceGutterRenderer that shows which lines have changed in the document.

Additionally, it is desirable to match the font of the GtkSourceMap and the GtkSourceView used for editing. Therefore, “font-desc” should be used to set the target font. You will need to adjust this to the desired font size for the map. A 1pt font generally seems to be an appropriate font size. "Monospace 1" is the default. See `pango_font_description_set_size()` for how to alter the size of an existing PangoFontDescription.

## Functions

### gtk_source_map_new ()

    GtkWidget *
    gtk_source_map_new (void);

Creates a new GtkSourceMap.

#### Returns

a new GtkSourceMap.

Since: 3.18

### gtk_source_map_set_view ()

    void
    gtk_source_map_set_view (GtkSourceMap *map,
                             GtkSourceView *view);

Sets the view that `map` will be doing the mapping to.

#### Parameters

map | a GtkSourceMap |
view | a GtkSourceView |

Since: 3.18

### gtk_source_map_get_view ()

    GtkSourceView *
    gtk_source_map_get_view (GtkSourceMap *map);

Gets the “view” property, which is the view this widget is mapping.

#### Parameters

map | a GtkSourceMap. |

#### Returns

a GtkSourceView or `NULL`.

[transfer none][nullable]

Since: 3.18

## Types and Values

### GtkSourceMap

    typedef struct _GtkSourceMap GtkSourceMap;

## Property Details

### The `“font-desc”` property

      “font-desc”                PangoFontDescription *

The Pango font description to use.

Owner: GtkSourceMap

Flags: Read / Write

### The `“view”` property

      “view”                     GtkSourceView *

The view this widget is mapping.

Owner: GtkSourceMap

Flags: Read / Write

## See Also

GtkSourceView