Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::Gtk::TextMark Class Reference

A GtkTextMark C++ wrapper class. More...

#include <xfc/gtk/textbuffer.hh>

Inheritance diagram for Xfc::Gtk::TextMark:

Xfc::G::Object Xfc::G::TypeInstance Xfc::Trackable Xfc::Gtk::SourceMarker List of all members.

Public Member Functions

Accessors
Methods

Detailed Description

A GtkTextMark C++ wrapper class.

A TextMark is like a bookmark in a text buffer; it preserves a position in the text across text buffer modifications. You can convert the mark to an iterator using Gtk::TextBuffer::get_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.

Marks are reference counted, but the reference count only controls the validity of the memory; marks can be deleted from the buffer at any time with Gtk::TextBuffer::delete_mark(). Once deleted from the buffer, a mark is essentially useless. Marks optionally have names. There are two marks built-in to TextBuffer; these are named "insert" and "selection_bound" and refer to the insertion point and the boundary of the selection which is not the insertion point, respectively. If no text is selected, these two marks will be in the same position. You can manipulate what is selected and where the cursor appears by moving these marks around.

TextMarks can optionally have names. These names can be convenient to avoid passing the TextMark object around. Marks are typically created using the Gtk::TextBuffer::create_mark() method.


Constructor & Destructor Documentation

Xfc::Gtk::TextMark::TextMark ( GtkTextMark *  mark,
bool  owns_reference = true 
) [explicit, protected]

Construct a new TextMark from an existing GtkTextMark.

Parameters:
mark A pointer to a GtkTextMark.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The mark can be a newly created GtkTextMark or an existing GtkTextMark (see G::Object::Object).

Xfc::Gtk::TextMark::TextMark ( GtkTextMark *  mark,
bool  owns_reference = true 
) [explicit, protected]

Construct a new TextMark from an existing GtkTextMark.

Parameters:
mark A pointer to a GtkTextMark.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The mark can be a newly created GtkTextMark or an existing GtkTextMark (see G::Object::Object).


Member Function Documentation

bool Xfc::Gtk::TextMark::get_deleted (  )  const

Returns true if the mark has been removed from its buffer with delete_mark().

Marks can't be used once deleted.

void Xfc::Gtk::TextMark::set_visible ( bool  setting  ) 

Sets the visibility of mark; the insertion point is normally visible, that is, you can see it as a vertical bar.

Parameters:
setting The visibility of mark.
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.


The documentation for this class was generated from the following file: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3