gtk.TextMark

gtk.TextMark — a position in a textbuffer that is preserved across textbuffer modifications

Synopsis

class gtk.TextMark(gobject.GObject):
    def set_visible(setting)
def get_visible()
def get_name()
def get_deleted()
def get_buffer()
def get_left_gravity()

Ancestry

+-- gobject.GObject
  +-- gtk.TextMark

gtk.TextMark Signal Prototypes

gobject.GObject Signal Prototypes

Description

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

Methods

gtk.TextMark.set_visible

    def set_visible(setting)
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.

gtk.TextMark.get_visible

    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)

gtk.TextMark.get_name

    def get_name()
Returns :the textmark name or None

The get_name() method returns the textmark name or None if the textmark is anonymous.

gtk.TextMark.get_deleted

    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.

gtk.TextMark.get_buffer

    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.

gtk.TextMark.get_left_gravity

    def get_left_gravity()
Returns :TRUE if the textmark has left gravity

The get_left_gravity() method returns TRUE if the textmark has left gravity.