Crea  Modifica  FrontPage  Indici  Cerca  Ultime modifiche  History  RSS  Login


class Gtk::TextMark

A Gtk::TextMark is like a bookmark in a text buffer; it preserves a position in the text. You can convert the mark to an iterator using Gtk::TextBuffer#iter_at_mark. Unlike iterators, marks remain valid across buffer mutations, because their behavior is defined when text is inserted or deleted. When text containing a mark is deleted, the mark remains in the position originally occupied by the deleted text. When text is inserted at a mark, a mark with left gravity will be moved to the beginning of the newly-inserted text, and a mark with right gravity will be moved to the end. "left" and "right" here refer to logical direction (left is the toward the start of the buffer); in some languages such as Hebrew the logically-leftmost text is not actually on the left when displayed.

Marks optionally have names; these can be convenient to avoid passing the Gtk::TextMark object around.

Marks are typically created using the Gtk::TextBuffer#create_mark.

Instance Methods

Gets the Gtk::TextBuffer this mark is located inside, or nil if the mark is deleted.
Returns true if the mark has been removed from its buffer with Gtk::TextBuffer#delete_mark. Marks can't be used once deleted.
  • Returns: true or false
Determines whether the mark has left gravity.
  • Returns: true if the mark has left gravity, false otherwise
Returns the mark name; returns nil for anonymous marks.
  • Returns: mark name or nil
Returns true if the mark is visible (i.e. a cursor is displayed for it)
  • Returns: true or false
Sets the visibility of mark; the insertion point is normally visible, i.e. you can see it as a vertical bar. Also, the text widget uses a visible mark to indicate where a drop will occur when dragging-and-dropping text. Most other marks are not visible. Marks are not visible by default.
  • setting: visibility of mark (true or false)
  • Returns: setting
Same as Gtk::TextMark#visible=.
  • setting: visibility of mark (true or false)
  • Returns: Gtk::TextMark
  • 2003-04-07 Masao: Move from The RWiki. Some modified.
  • 2002-12-14 OGASAWARA?
Ultima modifica:2005/11/17 02:43:41
Parola chiave:
Referenze:[Gtk::TextView] [Gtk::TextBuffer] [Gtk::TextIter] [Gtk::TextMark] [Gtk::SourceBuffer]