]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtktext.sgml
bracket in #ifdef GTK_ENABLE_BROKEN.
[~andy/gtk] / docs / reference / gtk / tmpl / gtktext.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkText
3
4 <!-- ##### SECTION Short_Description ##### -->
5 deprecated text widget, use #GtkTextView instead
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>\r
9 <warning>
10 <para>
11 #GtkText is deprecated and unsupported. It is known to be
12 buggy. To use it, you must define the symbol %GTK_ENABLE_BROKEN
13 prior to including the GTK+ header files. Use #GtkTextView instead.
14 </para>
15 </warning>
16 A #GtkText widget allows one to display any given text and manipulate it\r
17 by deleting from one point to another, selecting a region, and various\r
18 other functions as outlined below.  It is inherited from #GtkEditable.\r
19 </para>
20
21 <!-- ##### SECTION See_Also ##### -->
22 <para>\r
23 \r
24 </para>
25
26 <!-- ##### STRUCT GtkText ##### -->
27 <para>\r
28 Most of the #GtkText-struct struct members should not be accessed directly.\r
29 Listed below are a few exceptions and how to use them.\r
30 \r
31 <informaltable pgwide=1 frame="none" role="struct">\r
32 <tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*">\r
33 <tbody>\r
34 \r
35 <row>\r
36 <entry>GtkAdjustment *hadj;</entry>\r
37 <entry>Allows you to see the state of an attached horizontal #GtkScrollbar.\r
38 See #GtkAdjustment for more info. This allows easy access to the adjustments\r
39 of the #GtkText struct without having to keep track of ones that you initialize\r
40 at widget creation.</entry>\r
41 </row>\r
42 \r
43 <row>\r
44 <entry>GtkAdjustment *vadj;</entry>\r
45 <entry>Same as hadj except it involves the vertical #GtkScrollbar.</entry>\r
46 </row>\r
47 \r
48 </tbody></tgroup></informaltable>\r
49 \r
50 </para>
51
52
53 <!-- ##### STRUCT GtkTextFont ##### -->
54 <para>\r
55 Internal #GtkText data type.\r
56 <!-- Pretty sure.. declared in gtktext.c -->\r
57 </para>
58
59
60 <!-- ##### STRUCT GtkPropertyMark ##### -->
61 <para>\r
62 Internal #GtkText data type.  Should not be access directly.\r
63 <!-- FIXME: unsure about this  -->\r
64 </para>
65
66 @property: 
67 @offset: 
68 @index: 
69
70 <!-- ##### FUNCTION gtk_text_new ##### -->
71 <para>\r
72 Creates a new #GtkText widget, initialized with the given pointers to\r
73 #GtkAdjustments.  These pointers can be used to track the viewing position\r
74 of the #GtkText widget.  Passing NULL to either or both of them will make\r
75 the #GtkText create it's own.  You can set these later with the function\r
76 <function>gtk_text_set_adjustment()</function>\r
77 </para>
78
79 @hadj: horizontal adjustment.
80 @vadj: vertical adjustment.
81 @Returns: the new #GtkText widget.
82
83
84 <!-- ##### FUNCTION gtk_text_set_editable ##### -->
85 <para>\r
86 Set whether the #GtkText widget can be edited by the user or not.  This\r
87 still allows you the programmer to make changes with the various #GtkText\r
88 functions.\r
89 </para>
90
91 @text: the #GtkText widget
92 @editable: %TRUE makes it editable, %FALSE makes it immutable by the user
93
94
95 <!-- ##### FUNCTION gtk_text_set_word_wrap ##### -->
96 <para>\r
97 Sets whether the #GtkText widget wraps words down to the next line if it\r
98 can't be completed on the current line.\r
99 </para>
100
101 @text: the #GtkText widget
102 @word_wrap: %TRUE makes it word wrap, %FALSE disables word wrapping
103
104
105 <!-- ##### FUNCTION gtk_text_set_line_wrap ##### -->
106 <para>\r
107 Controls how #GtkText handles long lines of continuous text.  If line wrap\r
108 is on, the line is broken when it reaches the extent of the #GtkText widget\r
109 viewing area and the rest is displayed on the next line.  If it is not set,\r
110 the line continues regardless size of current viewing area.  Similar to word\r
111 wrap but it disregards word boundaries.\r
112 </para>
113
114 @text: the #GtkText widget
115 @line_wrap: %TRUE turns line wrap on, %FALSE turns it off
116
117
118 <!-- ##### FUNCTION gtk_text_set_adjustments ##### -->
119 <para>\r
120 Allows you to set #GtkAdjustment pointers which in turn allows you to\r
121 keep track of the viewing position of the #GtkText widget.\r
122 </para>
123
124 @text: the #GtkText widget
125 @hadj: the horizontal adjustment
126 @vadj: the vertical adjustment
127
128
129 <!-- ##### FUNCTION gtk_text_set_point ##### -->
130 <para>\r
131 Sets the cursor at the given point.  In this case a point constitutes\r
132 the number of characters from the extreme upper left corner of the #GtkText\r
133 widget.\r
134 </para>
135
136 @text: the #GtkText widget
137 @index: the number of characters from the upper left corner
138
139
140 <!-- ##### FUNCTION gtk_text_get_point ##### -->
141 <para>\r
142 Gets the current position of the cursor as the number of characters from\r
143 the upper left corner of the #GtkText widget.\r
144 </para>
145
146 @text: the #GtkText widget
147 @Returns: the number of characters from the upper left corner
148
149
150 <!-- ##### FUNCTION gtk_text_get_length ##### -->
151 <para>\r
152 Returns the length of the all the text contained within the #GtkText widget;\r
153 disregards current point position.\r
154 </para>
155
156 @text: the #GtkText widget
157 @Returns: the length of the text
158
159
160 <!-- ##### FUNCTION gtk_text_freeze ##### -->
161 <para>\r
162 Freezes the #GtkText widget which disallows redrawing of the widget until\r
163 it is thawed.  This is useful if a large number of changes are going to\r
164 made to the text within the widget, reducing the amount of flicker seen\r
165 by the user.\r
166 </para>
167
168 @text: the #GtkText widget
169
170
171 <!-- ##### FUNCTION gtk_text_thaw ##### -->
172 <para>\r
173 Allows the #GtkText widget to be redrawn again by GTK.\r
174 </para>
175
176 @text: the #GtkText widget
177
178
179 <!-- ##### FUNCTION gtk_text_insert ##### -->
180 <para>\r
181 Inserts given text into the #GtkText widget with the given properties as\r
182 outlined below.\r
183 </para>
184
185 @text: the #GtkText widget
186 @font: the #GdkFont to use
187 @fore: the foreground color to insert with
188 @back: the background color to insert with
189 @chars: the actual text to be inserted
190 @length: the length of the text to be inserted, passing -1 makes it insert\r
191 all the text.
192
193
194 <!-- ##### FUNCTION gtk_text_backward_delete ##### -->
195 <para>\r
196 Deletes from the current point position backward the given number of\r
197 characters.\r
198 </para>
199
200 @text: the #GtkText widget
201 @nchars: the number of characters to delete
202 @Returns: %TRUE if the operation was successful, otherwise returns %FALSE
203
204
205 <!-- ##### FUNCTION gtk_text_forward_delete ##### -->
206 <para>\r
207 Deletes from the current point position forward the given number of\r
208 characters.\r
209 </para>
210
211 @text: the #GtkText widget
212 @nchars: the number of characters to delete
213 @Returns: %TRUE if the operation was successful, otherwise returns %FALSE
214
215
216 <!-- ##### MACRO GTK_TEXT_INDEX ##### -->
217 <para>\r
218 Returns the character at the given index within the #GtkText widget.\r
219 </para>
220
221 @t: the #GtkText widget
222 @index: the number of characters from the upper left corner
223
224
225 <!-- ##### SIGNAL GtkText::set-scroll-adjustments ##### -->
226 <para>
227
228 </para>
229
230 @text: the object which received the signal.
231 @arg1: 
232 @arg2: 
233
234 <!-- ##### ARG GtkText:hadjustment ##### -->
235 <para>\r
236 Used by the #GtkText widget to keep track of the size of it's horizontal\r
237 text.\r
238 </para>
239
240 <!-- ##### ARG GtkText:vadjustment ##### -->
241 <para>\r
242 Used by the #GtkText widget to keep track of the size of it's vertical\r
243 text.\r
244 </para>
245
246 <!-- ##### ARG GtkText:line-wrap ##### -->
247 <para>\r
248 Boolean value indicating whether line wrap is enabled or not.\r
249 </para>
250
251 <!-- ##### ARG GtkText:word-wrap ##### -->
252 <para>\r
253 Boolean value indicated whether word wrap is enabled or not.\r
254 </para>
255