1
2@c %start of fragment
3
4@deftp Class <gtk-editable>
5Derives from @code{<ginterface>}.
6
7This class defines no direct slots.
8
9@end deftp
10
11@defop Signal <gtk-editable> changed
12Indicates that the user has changed the contents of the widget.
13
14@end defop
15
16@defop Signal <gtk-editable> insert-text  (arg0@tie{}@code{<gchararray>}) (arg1@tie{}@code{<gint>}) (arg2@tie{}@code{<gpointer>})
17This signal is emitted when text is inserted into the widget by the user. The
18default handler for this signal will normally be responsible for inserting the
19text, so by connecting to this signal and then stopping the signal with
20@code{gtk-signal-emit-stop}, it is possible to modify the inserted text, or
21prevent it from being inserted entirely.
22
23@end defop
24
25@defop Signal <gtk-editable> delete-text  (arg0@tie{}@code{<gint>}) (arg1@tie{}@code{<gint>})
26This signal is emitted when text is deleted from the widget by the user. The
27default handler for this signal will normally be responsible for inserting the
28text, so by connecting to this signal and then stopping the signal with
29@code{gtk-signal-emit-stop}, it is possible to modify the inserted text, or
30prevent it from being inserted entirely. The @var{start-pos} and @var{end-pos}
31parameters are interpreted as for @code{gtk-editable-delete-text}
32
33@end defop
34
35@deffn Function gtk-editable-select-region  (self@tie{}@code{<gtk-editable>}) (start@tie{}@code{int}) (end@tie{}@code{int})
36@deffnx Method select-region
37Selects a region of text. The characters that are selected are those characters
38at positions from @var{start-pos} up to, but not including @var{end-pos}. If
39@var{end-pos} is negative, then the the characters selected will be those
40characters from @var{start-pos} to the end of the text.
41
42@table @var
43@item editable
44a @code{<gtk-editable>} widget.
45
46@item start
47the starting position.
48
49@item end
50the end position.
51
52@end table
53
54@end deffn
55
56@deffn Function gtk-editable-get-selection-bounds  (self@tie{}@code{<gtk-editable>}) @result{}@tie{} (ret@tie{}@code{bool}) (start@tie{}@code{int}) (end@tie{}@code{int})
57@deffnx Method get-selection-bounds
58Gets the current selection bounds, if there is a selection.
59
60@table @var
61@item editable
62a @code{<gtk-editable>} widget.
63
64@item start
65location to store the starting position, or @samp{@code{#f}}.
66
67@item end
68location to store the end position, or @samp{@code{#f}}.
69
70@item ret
71@samp{@code{#t}} if there is a selection.
72
73@end table
74
75@end deffn
76
77@deffn Function gtk-editable-insert-text  (self@tie{}@code{<gtk-editable>}) (new_text@tie{}@code{mchars}) (position@tie{}@code{int}) @result{}@tie{} (ret@tie{}@code{int})
78@deffnx Method insert-text
79Inserts text at a given position.
80
81@table @var
82@item editable
83a @code{<gtk-editable>} widget.
84
85@item new-text
86the text to insert.
87
88@item new-text-length
89the length of the text to insert, in bytes
90
91@item position
92an inout parameter. The caller initializes it to the position at which to insert
93the text. After the call it points at the position after the newly inserted
94text.
95
96@end table
97
98@end deffn
99
100@deffn Function gtk-editable-delete-text  (self@tie{}@code{<gtk-editable>}) (start_pos@tie{}@code{int}) (end_pos@tie{}@code{int})
101@deffnx Method delete-text
102Deletes a sequence of characters. The characters that are deleted are those
103characters at positions from @var{start-pos} up to, but not including
104@var{end-pos}. If @var{end-pos} is negative, then the the characters deleted
105will be those characters from @var{start-pos} to the end of the text.
106
107@table @var
108@item editable
109a @code{<gtk-editable>} widget.
110
111@item start-pos
112the starting position.
113
114@item end-pos
115the end position.
116
117@end table
118
119@end deffn
120
121@deffn Function gtk-editable-get-chars  (self@tie{}@code{<gtk-editable>}) (start_pos@tie{}@code{int}) (end_pos@tie{}@code{int}) @result{}@tie{} (ret@tie{}@code{mchars})
122@deffnx Method get-chars
123Retrieves a sequence of characters. The characters that are retrieved are those
124characters at positions from @var{start-pos} up to, but not including
125@var{end-pos}. If @var{end-pos} is negative, then the the characters retrieved
126will be those characters from @var{start-pos} to the end of the text.
127
128@table @var
129@item editable
130a @code{<gtk-editable>} widget.
131
132@item start-pos
133the starting position.
134
135@item end-pos
136the end position.
137
138@item ret
139the characters in the indicated region. The result must be freed with
140@code{g-free} when the application is finished with it.
141
142@end table
143
144@end deffn
145
146@deffn Function gtk-editable-cut-clipboard  (self@tie{}@code{<gtk-editable>})
147@deffnx Method cut-clipboard
148Causes the characters in the current selection to be copied to the clipboard and
149then deleted from the widget.
150
151@table @var
152@item editable
153a @code{<gtk-editable>} widget.
154
155@end table
156
157@end deffn
158
159@deffn Function gtk-editable-copy-clipboard  (self@tie{}@code{<gtk-editable>})
160@deffnx Method copy-clipboard
161Causes the characters in the current selection to be copied to the clipboard.
162
163@table @var
164@item editable
165a @code{<gtk-editable>} widget.
166
167@end table
168
169@end deffn
170
171@deffn Function gtk-editable-paste-clipboard  (self@tie{}@code{<gtk-editable>})
172@deffnx Method paste-clipboard
173Causes the contents of the clipboard to be pasted into the given widget at the
174current cursor position.
175
176@table @var
177@item editable
178a @code{<gtk-editable>} widget.
179
180@end table
181
182@end deffn
183
184@deffn Function gtk-editable-delete-selection  (self@tie{}@code{<gtk-editable>})
185@deffnx Method delete-selection
186Deletes the current contents of the widgets selection and disclaims the
187selection.
188
189@table @var
190@item editable
191a @code{<gtk-editable>} widget.
192
193@end table
194
195@end deffn
196
197@deffn Function gtk-editable-set-position  (self@tie{}@code{<gtk-editable>}) (position@tie{}@code{int})
198@deffnx Method set-position
199Sets the cursor position.
200
201@table @var
202@item editable
203a @code{<gtk-editable>} widget.
204
205@item position
206the position of the cursor. The cursor is displayed before the character with
207the given (base 0) index in the widget. The value must be less than or equal to
208the number of characters in the widget. A value of -1 indicates that the
209position should be set after the last character in the entry. Note that this
210position is in characters, not in bytes.
211
212@end table
213
214@end deffn
215
216@deffn Function gtk-editable-get-position  (self@tie{}@code{<gtk-editable>}) @result{}@tie{} (ret@tie{}@code{int})
217@deffnx Method get-position
218Retrieves the current cursor position.
219
220@table @var
221@item editable
222a @code{<gtk-editable>} widget.
223
224@item ret
225the position of the cursor. The cursor is displayed before the character with
226the given (base 0) index in the widget. The value will be less than or equal to
227the number of characters in the widget. Note that this position is in
228characters, not in bytes.
229
230@end table
231
232@end deffn
233
234@deffn Function gtk-editable-set-editable  (self@tie{}@code{<gtk-editable>}) (is_editable@tie{}@code{bool})
235@deffnx Method set-editable
236Determines if the user can edit the text in the editable widget or not.
237
238@table @var
239@item editable
240a @code{<gtk-editable>} widget.
241
242@item is-editable
243@samp{@code{#t}} if the user is allowed to edit the text in the widget.
244
245@end table
246
247@end deffn
248
249@deffn Function gtk-editable-get-editable  (self@tie{}@code{<gtk-editable>}) @result{}@tie{} (ret@tie{}@code{bool})
250@deffnx Method get-editable
251Retrieves whether @var{editable} is editable. See
252@code{gtk-editable-set-editable}.
253
254@table @var
255@item editable
256a @code{<gtk-editable>}
257
258@item ret
259@samp{@code{#t}} if @var{editable} is editable.
260
261@end table
262
263@end deffn
264
265
266@c %end of fragment
267