1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
6 A position in the buffer preserved across buffer modifications
8 <!-- ##### SECTION Long_Description ##### -->
10 You may wish to begin by reading the <link linkend="TextWidget">text widget
11 conceptual overview</link> which gives an overview of all the objects and data
12 types related to the text widget and how they work together.
16 A #GtkTextMark is like a bookmark in a text buffer; it preserves a position in
17 the text. You can convert the mark to an iterator using
18 gtk_text_buffer_get_iter_at_mark(). Unlike iterators, marks remain valid across
19 buffer mutations, because their behavior is defined when text is inserted or
20 deleted. When text containing a mark is deleted, the mark remains in the
21 position originally occupied by the deleted text. When text is inserted at a
22 mark, a mark with <firstterm>left gravity</firstterm> will be moved to the
23 beginning of the newly-inserted text, and a mark with <firstterm>right
24 gravity</firstterm> will be moved to the end.
28 "left" and "right" here refer to logical direction (left is the toward the start
29 of the buffer); in some languages such as Hebrew the logically-leftmost text is
30 not actually on the left when displayed.
36 Marks are reference counted, but the reference count only controls the validity
37 of the memory; marks can be deleted from the buffer at any time with
38 gtk_text_buffer_delete_mark(). Once deleted from the buffer, a mark is
43 Marks optionally have names; these can be convenient to avoid passing the
44 #GtkTextMark object around.
48 Marks are typically created using the gtk_text_buffer_create_mark() function.
51 <!-- ##### SECTION See_Also ##### -->
56 <!-- ##### STRUCT GtkTextMark ##### -->
62 <!-- ##### FUNCTION gtk_text_mark_set_visible ##### -->
71 <!-- ##### FUNCTION gtk_text_mark_get_visible ##### -->
80 <!-- ##### FUNCTION gtk_text_mark_get_deleted ##### -->
89 <!-- ##### FUNCTION gtk_text_mark_get_name ##### -->
98 <!-- ##### FUNCTION gtk_text_mark_get_buffer ##### -->