:right-sidebar: True MarkerLayer =================================================================== .. currentmodule:: gi.repository.Shumate .. class:: MarkerLayer(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Shumate.Layer`, :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.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` Displays markers on the map. It is responsible for positioning markers correctly, marker selections and group marker operations. Constructors ------------ .. rst-class:: interim-class .. class:: MarkerLayer :no-index: .. classmethod:: new(viewport: ~gi.repository.Shumate.Viewport) -> ~gi.repository.Shumate.MarkerLayer Creates a new instance of :obj:`~gi.repository.Shumate.MarkerLayer`\. :param viewport: the ``ShumateViewport`` .. classmethod:: new_full(viewport: ~gi.repository.Shumate.Viewport, mode: ~gi.repository.Gtk.SelectionMode) -> ~gi.repository.Shumate.MarkerLayer Creates a new instance of :obj:`~gi.repository.Shumate.MarkerLayer` with the specified selection mode. :param viewport: the ``ShumateViewport`` :param mode: Selection mode Methods ------- .. rst-class:: interim-class .. class:: MarkerLayer :no-index: .. method:: add_marker(marker: ~gi.repository.Shumate.Marker) -> None Adds the marker to the layer. :param marker: a :obj:`~gi.repository.Shumate.Marker` .. method:: get_markers() -> list[~gi.repository.Shumate.Marker] Gets a copy of the list of all markers inserted into the layer. You should free the list but not its contents. .. method:: get_selected() -> list[~gi.repository.Shumate.Marker] Gets a list of selected markers in the layer. .. method:: get_selection_mode() -> ~gi.repository.Gtk.SelectionMode Gets the selection mode of the layer. .. method:: remove_all() -> None Removes all markers from the layer. .. method:: remove_marker(marker: ~gi.repository.Shumate.Marker) -> None Removes the marker from the layer. :param marker: a :obj:`~gi.repository.Shumate.Marker` .. method:: select_all_markers() -> None Selects all selectable markers in the layer. .. method:: select_marker(marker: ~gi.repository.Shumate.Marker) -> bool Selects a marker in this layer. If :obj:`~gi.repository.Shumate.MarkerLayer`\:selection-mode is %GTK_SELECTION_SINGLE or %GTK_SELECTION_BROWSE, all other markers will be unselected. If the mode is %GTK_SELECTION_NONE or ``marker`` is not selectable, nothing will happen. :param marker: a :obj:`~gi.repository.Shumate.Marker` that is a child of ``self`` .. method:: set_selection_mode(mode: ~gi.repository.Gtk.SelectionMode) -> None Sets the selection mode of the layer. NOTE: changing selection mode to %GTK_SELECTION_NONE, %GTK_SELECTION_SINGLE or %GTK_SELECTION_BROWSE will clear all previously selected markers. :param mode: a :obj:`~gi.repository.Gtk.SelectionMode` value .. method:: unselect_all_markers() -> None Unselects all markers in the layer. .. method:: unselect_marker(marker: ~gi.repository.Shumate.Marker) -> None Unselects a marker in this layer. This works even if :obj:`~gi.repository.Shumate.MarkerLayer`\:selection-mode is %GTK_SELECTION_BROWSE. Browse mode only prevents user interaction, not the program, from unselecting a marker. :param marker: a :obj:`~gi.repository.Shumate.Marker` that is a child of ``self`` Properties ---------- .. rst-class:: interim-class .. class:: MarkerLayer :no-index: .. attribute:: props.selection_mode :type: ~gi.repository.Gtk.SelectionMode The type of the None singleton. Signals ------- .. rst-class:: interim-class .. class:: MarkerLayer.signals :no-index: .. method:: marker_selected(marker: ~gi.repository.Shumate.Marker) -> None The type of the None singleton. :param marker: The marker that was selected .. method:: marker_unselected(marker: ~gi.repository.Shumate.Marker) -> None The type of the None singleton. :param marker: The marker that was unselected