gtk.TextMark — a position in a textbuffer that is preserved across textbuffer modifications
class gtk.TextMark( |
A gtk.TextMark
is
like a bookmark in a textbuffer - it preserves a position in the text. You
can get an iterator corresponding to a textmark by using the gtk.TextBuffer.get_iter_at_mark
()
method. Unlike iterators, textmarks remain valid across buffer modifications
(e.g. when text is inserted or deleted). When text containing a textmark is
deleted, the textmark remains in the position originally occupied by the
deleted text. When text is inserted at a textmark, a textmark with left
gravity will be moved to the beginning of the newly-inserted text, and a
textmark with right gravity will be moved to the end. Textmarks optionally
have names that can be used to avoid passing the gtk.TextMark
object around. Textmarks are typically created using the gtk.TextBuffer.create_mark
()
method. A gtk.TextBuffer
has two built-in gtk.TextMark
objects named: insert
and
selection_bound
which refer to the insertion point and
the boundary of the selection (these may refer to the same location).
def set_visible(setting
)
| if True the textmark is
visible |
The set_visible
() method sets the
visibility of the textmark to the value specified by
setting
. If setting
is
True
the textmark will be visible as a vertical bar. The
insertion point is normally visible but most textmarks are not visible by
default. The text widget uses a visible textmark to indicate where a drop
will occur when dragging-and-dropping text.
def get_visible()
Returns : | True if the textmark is
visible |
The get_visible
() method returns
True
if the textmark is visible (i.e. a vertical bar is
displayed for it)
def get_name()
Returns : | the textmark name or
None |
The get_name
() method returns the
textmark name or None
if the textmark is
anonymous.
def get_deleted()
Returns : | True if the textmark is
deleted |
The get_deleted
() method returns
True
if the textmark has been removed from its textbuffer
with gtk.TextBuffer.delete_mark
().
Textmarks can't be used once deleted.
def get_buffer()
Returns : | the textmark's gtk.TextBuffer |
The get_buffer
() method returns the
gtk.TextBuffer
object the textmark is located inside, or None
if the
textmark is deleted.