gtksourceview2.Mark

gtksourceview2.Mark — Mark object for gtksourceview.SourceView

Synopsis

class gtksourceview2.Mark(gtk.TextMark):
    gtksourceview2.Mark(name, category)
def get_category()
def next(category)
def prev(category)

Ancestry

+-- gobject.GObject
    +-- gtk.TextMark
        +-- gtksourceview2.Mark

Properties

"category"Read-Write-Construct OnlyThe category of the gtksourceview2.Mark, classified the mark and control what pixbuf is used and with which priority it is drawn. Default value: None

Description

A gtksourceview2.Mark preserves a position in the text where you want to display additional info. It is based on gtk.TextMark and thus is still valid after the text has changed though it may change it's position.

gtksourceview2.Mark are organised in categories which you have to set when you create the mark. Each category can have a pixbuf and a priority associated using gtksourceview2.View.set_mark_category_pixbuf() and gtksourceview2.View.set_mark_category_priority(). 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.

Constructor

    gtksourceview2.Mark(name, category)

name :

name of the gtksourceview2.Mark,can be None when not using a name.

category :

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).

Returns :

a new gtksourceview2.Mark.

Creates a new gtksourceview2.Mark. Add it to a buffer using gtk.TextBuffer.add_mark(). If name is None, the mark is anonymous; otherwise, the mark can be retrieved by name using gtk.TextBuffer.get_mark(). Normally marks are created using the utility function gtksourceview2.Buffer.create_mark().

Methods

gtksourceview2.Mark.get_category

    def get_category()

Returns :

the category.

The get_category() method returns the category of gtksourceview2.Mark.

gtksourceview2.Mark.next

    def next(category)

category :

a string specifying the mark category or None.

Returns :

the next gtksourceview2.Mark or None.

The next() method returns the next gtksourceview2.Mark in the buffer or None if the mark was not added to a buffer. If there is no next mark, None will be returned. If category is None, looks for marks of any category.

gtksourceview2.Mark.prev

    def prev(category)

category :

a string specifying the mark category or None.

Returns :

the previous gtksourceview2.Mark or None.

The prev() method returns the previous gtksourceview2.Mark in the buffer or None if the mark was not added to a buffer. If there is no next mark, None will be returned. If category is None, looks for marks of any category.