Mark#
Superclasses: TextMark, Object
Mark object for Buffer.
A GtkSourceMark marks a position in the text where you want to display
additional info. It is based on TextMark and thus is still valid after
the text has changed though its position may change.
GtkSourceMarks 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 set_mark_attributes.
The pixbuf will be displayed in the margin at the line where the mark
residents if the show_line_marks property is set to 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#
- class Mark
- classmethod new(name: str | None, category: str) Mark#
Creates a text mark.
Add it to a buffer using
add_mark. If name is NULL, the mark is anonymous; otherwise, the mark can be retrieved by name usingget_mark. Normally marks are created using the utility functioncreate_source_mark.- Parameters:
name – Name of the
MarkorNonecategory – 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#
- class Mark
-
- next(category: str | None = None) Mark | None#
Returns the next
GtkSourceMarkin the buffer orNoneif the mark was not added to a buffer.If there is no next mark,
Nonewill be returned.If
categoryisNone, looks for marks of any category.- Parameters:
category – a string specifying the mark category, or
None.
- prev(category: str | None = None) Mark | None#
Returns the previous
GtkSourceMarkin the buffer orNoneif the mark was not added to a buffer.If there is no previous mark,
Noneis returned.If
categoryisNone, looks for marks of any category- Parameters:
category – a string specifying the mark category, or
None.
Properties#
Fields#
- class Mark
- parent_instance#