GtkSource.Map

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget Gtk.Scrollable Gtk.Scrollable GObject.GInterface->Gtk.Scrollable GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.TextView Gtk.TextView Gtk.Scrollable->Gtk.TextView GtkSource.View GtkSource.View Gtk.TextView->GtkSource.View Gtk.Widget->Gtk.TextView GtkSource.Map GtkSource.Map GtkSource.View->GtkSource.Map

Subclasses:

None

Methods

Inherited:

GtkSource.View (42), Gtk.TextView (73), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Scrollable (9)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

get_view ()

set_view (view)

Virtual Methods

Inherited:

GtkSource.View (5), Gtk.TextView (12), Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9), Gtk.Scrollable (1)

Properties

Inherited:

GtkSource.View (17), Gtk.TextView (21), Gtk.Widget (34), Gtk.Accessible (1), Gtk.Scrollable (4)

Name

Type

Flags

Short Description

font-desc

Pango.FontDescription

r/w

The Pango font description to use.

view

GtkSource.View

r/w

The view this widget is mapping.

Signals

Inherited:

GtkSource.View (10), Gtk.TextView (15), Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

GtkSource.View (10), Gtk.TextView (15), Gtk.Widget (13), GObject.Object (1)

Name

Type

Access

Description

parent_instance

GtkSource.View

r

Class Details

class GtkSource.Map(**kwargs)
Bases:

GtkSource.View

Abstract:

No

Structure:

GtkSource.MapClass

Widget that displays a map for a specific [class`View`].

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

This works by connecting a [class`View`] to to the GtkSourceMap using the [property`Map`:py:data::view<GtkSource.Map.props.view>] property or [method`Map`.set_view].

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

Additionally, it is desirable to match the font of the GtkSourceMap and the [class`View`] used for editing. Therefore, [property`Map`:py:data::font-desc<GtkSource.Map.props.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 [method`Pango`.FontDescription.set_size] for how to alter the size of an existing [struct`Pango`.FontDescription].

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

classmethod new()
Returns:

a new GtkSource.Map.

Return type:

Gtk.Widget

Creates a new GtkSourceMap.

get_view()
Returns:

a GtkSource.View or None.

Return type:

GtkSource.View or None

Gets the [property`Map`:py:data::view<GtkSource.Map.props.view>] property, which is the view this widget is mapping.

set_view(view)
Parameters:

view (GtkSource.View) – a GtkSource.View

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

Property Details

GtkSource.Map.props.font_desc
Name:

font-desc

Type:

Pango.FontDescription

Default Value:

None

Flags:

READABLE, WRITABLE

The Pango font description to use.

GtkSource.Map.props.view
Name:

view

Type:

GtkSource.View

Default Value:

None

Flags:

READABLE, WRITABLE

The view this widget is mapping.