]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtktextmark.sgml
204b00be577efc1ee8d1a1b5a5a584fd449efa1f
[~andy/gtk] / docs / reference / gtk / tmpl / gtktextmark.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkTextMark
3
4 <!-- ##### SECTION Short_Description ##### -->
5
6 A position in the buffer preserved across buffer modifications
7
8 <!-- ##### SECTION Long_Description ##### -->
9 <para>
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.
13 </para>
14
15 <para>
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. 
25
26 <footnote>
27 <para>
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.
31 </para>
32 </footnote>
33 </para>
34
35 <para>
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
39 essentially useless.
40 </para>
41
42 <para>
43 Marks optionally have names; these can be convenient to avoid passing the 
44 #GtkTextMark object around.
45 </para>
46
47 <para>
48 Marks are typically created using the gtk_text_buffer_create_mark() function.
49 </para>
50
51 <!-- ##### SECTION See_Also ##### -->
52 <para>
53
54 </para>
55
56 <!-- ##### STRUCT GtkTextMark ##### -->
57 <para>
58
59 </para>
60
61 @parent_instance: 
62 @segment: 
63
64 <!-- ##### FUNCTION gtk_text_mark_set_visible ##### -->
65 <para>
66
67 </para>
68
69 @mark: 
70 @setting: 
71
72
73 <!-- ##### FUNCTION gtk_text_mark_get_visible ##### -->
74 <para>
75
76 </para>
77
78 @mark: 
79 @Returns: 
80
81
82 <!-- ##### FUNCTION gtk_text_mark_get_deleted ##### -->
83 <para>
84
85 </para>
86
87 @mark: 
88 @Returns: 
89
90
91 <!-- ##### FUNCTION gtk_text_mark_get_name ##### -->
92 <para>
93
94 </para>
95
96 @mark: 
97 @Returns: 
98
99
100 <!-- ##### FUNCTION gtk_text_mark_get_buffer ##### -->
101 <para>
102
103 </para>
104
105 @mark: 
106 @Returns: 
107
108