:right-sidebar: True Mark =================================================================== .. currentmodule:: gi.repository.GtkSource .. class:: Mark(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.TextMark`, :class:`~gi.repository.GObject.Object` Mark object for :obj:`~gi.repository.GtkSource.Buffer`\. A ``GtkSourceMark`` marks a position in the text where you want to display additional info. It is based on :obj:`~gi.repository.Gtk.TextMark` and thus is still valid after the text has changed though its position may change. ``GtkSourceMark``\s are organized in categories which you have to set when you create the mark. Each category can have a priority, a pixbuf and other associated attributes. See :obj:`~gi.repository.View.set_mark_attributes`\. The pixbuf will be displayed in the margin at the line where the mark residents if the :obj:`~gi.repository.GtkSource.View.props.show_line_marks` property is set to :const:`True`. If there are multiple marks in the same line, the pixbufs will be drawn on top of each other. The mark with the highest priority will be drawn on top. Constructors ------------ .. rst-class:: interim-class .. class:: Mark :no-index: .. classmethod:: new(name: str | None, category: str) -> ~gi.repository.GtkSource.Mark Creates a text mark. Add it to a buffer using :obj:`~gi.repository.Gtk.TextBuffer.add_mark`\. If name is NULL, the mark is anonymous; otherwise, the mark can be retrieved by name using :obj:`~gi.repository.Gtk.TextBuffer.get_mark`\. Normally marks are created using the utility function :obj:`~gi.repository.Buffer.create_source_mark`\. :param name: Name of the :obj:`~gi.repository.GtkSource.Mark` or :const:`None` :param category: is used to classify marks according to common characteristics (e.g. all the marks representing a bookmark could belong to the "bookmark" category, or all the marks representing a compilation error could belong to "error" category). Methods ------- .. rst-class:: interim-class .. class:: Mark :no-index: .. method:: get_category() -> str Returns the mark category. .. method:: next(category: str | None = None) -> ~gi.repository.GtkSource.Mark | None Returns the next ``GtkSourceMark`` in the buffer or :const:`None` if the mark was not added to a buffer. If there is no next mark, :const:`None` will be returned. If ``category`` is :const:`None`, looks for marks of any category. :param category: a string specifying the mark category, or :const:`None`. .. method:: prev(category: str | None = None) -> ~gi.repository.GtkSource.Mark | None Returns the previous ``GtkSourceMark`` in the buffer or :const:`None` if the mark was not added to a buffer. If there is no previous mark, :const:`None` is returned. If ``category`` is :const:`None`, looks for marks of any category :param category: a string specifying the mark category, or :const:`None`. Properties ---------- .. rst-class:: interim-class .. class:: Mark :no-index: .. attribute:: props.category :type: str The type of the None singleton. Fields ------ .. rst-class:: interim-class .. class:: Mark :no-index: .. attribute:: parent_instance