Map

class Map(**properties: Any)

Superclasses: View, TextView, Widget, InitiallyUnowned, Object

Implemented Interfaces: Accessible, AccessibleText, Buildable, ConstraintTarget, Scrollable

Widget that displays a map for a specific View.

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

This works by connecting a View to to the GtkSourceMap using the view property or set_view.

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

Additionally, it is desirable to match the font of the GtkSourceMap and the View 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 set_size for how to alter the size of an existing FontDescription.

When FontConfig is available, GtkSourceMap will try to use a bundled “block” font to make the map more legible.

Constructors

class Map
classmethod new() Widget

Creates a new GtkSourceMap.

Methods

class Map
get_view() View | None

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

set_view(view: View) None

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

Parameters:

view – a View

Properties

class Map
props.font_desc: FontDescription
props.view: View

Fields

class Map
parent_instance