:right-sidebar: True Map =================================================================== .. currentmodule:: gi.repository.GtkSource .. class:: Map(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GtkSource.View`, :class:`~gi.repository.Gtk.TextView`, :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.AccessibleText`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget`, :class:`~gi.repository.Gtk.Scrollable` Widget that displays a map for a specific :obj:`~gi.repository.GtkSource.View`\. ``GtkSourceMap`` is a widget that maps the content of a :obj:`~gi.repository.GtkSource.View` into a smaller view so the user can have a quick overview of the whole document. This works by connecting a :obj:`~gi.repository.GtkSource.View` to to the ``GtkSourceMap`` using the :obj:`~gi.repository.GtkSource.Map.props.view` property or :obj:`~gi.repository.Map.set_view`\. ``GtkSourceMap`` is a :obj:`~gi.repository.GtkSource.View` object. This means that you can add a :obj:`~gi.repository.GtkSource.GutterRenderer` to a gutter in the same way you would for a :obj:`~gi.repository.GtkSource.View`\. One example might be a :obj:`~gi.repository.GtkSource.GutterRenderer` that shows which lines have changed in the document. Additionally, it is desirable to match the font of the ``GtkSourceMap`` and the :obj:`~gi.repository.GtkSource.View` used for editing. Therefore, :obj:`~gi.repository.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 :obj:`~gi.repository.Pango.FontDescription.set_size` for how to alter the size of an existing :obj:`~gi.repository.Pango.FontDescription`\. When FontConfig is available, ``GtkSourceMap`` will try to use a bundled "block" font to make the map more legible. Constructors ------------ .. rst-class:: interim-class .. class:: Map :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``GtkSourceMap``\. Methods ------- .. rst-class:: interim-class .. class:: Map :no-index: .. method:: get_view() -> ~gi.repository.GtkSource.View | None Gets the :obj:`~gi.repository.GtkSource.Map.props.view` property, which is the view this widget is mapping. .. method:: set_view(view: ~gi.repository.GtkSource.View) -> None Sets the view that ``map`` will be doing the mapping to. :param view: a :obj:`~gi.repository.GtkSource.View` Properties ---------- .. rst-class:: interim-class .. class:: Map :no-index: .. attribute:: props.font_desc :type: ~gi.repository.Pango.FontDescription The type of the None singleton. .. attribute:: props.view :type: ~gi.repository.GtkSource.View The type of the None singleton. Fields ------ .. rst-class:: interim-class .. class:: Map :no-index: .. attribute:: parent_instance