1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 a single line text entry field.
7 <!-- ##### SECTION Long_Description ##### -->
9 The #GtkEntry widget is a single line text entry
10 widget. A fairly large set of key bindings are supported
11 by default. If the entered text is longer than the allocation
12 of the widget, the widget will scroll so that the cursor
16 <!-- ##### SECTION See_Also ##### -->
22 <listitem><para>a widget for handling multi-line text entry.</para></listitem>
28 <!-- ##### STRUCT GtkEntry ##### -->
30 The #GtkEntry-struct struct contains only private data.
50 <!-- ##### FUNCTION gtk_entry_new ##### -->
52 Creates a new #GtkEntry widget.
55 @Returns: a new #GtkEntry.
58 <!-- ##### FUNCTION gtk_entry_new_with_max_length ##### -->
60 Creates a new #GtkEntry widget with the given maximum
64 Note: the existance of this function is inconsistent
65 with the rest of the GTK+ API. The normal setup would
66 be to just require the user to make an extra call
67 to gtk_entry_set_max_length() instead. It is not
68 expected that this function will be removed, but
69 it would be better practice not to use it.
72 @max: the new maximum length.
73 @Returns: a new #GtkEntry.
76 <!-- ##### FUNCTION gtk_entry_set_text ##### -->
78 Sets the text in the widget to the given
79 value, replacing the current contents.
86 <!-- ##### FUNCTION gtk_entry_append_text ##### -->
88 Appends the given text to the contents of the widget.
92 @text: the text to append.
95 <!-- ##### FUNCTION gtk_entry_prepend_text ##### -->
97 Prepends the given text to the contents of th ewidget.
101 @text: the text to prepend.
104 <!-- ##### FUNCTION gtk_entry_set_position ##### -->
106 Sets the cursor position in an entry to the given
107 value. This function is obsolete. You should use
108 gtk_editable_set_position() instead.
112 @position: the position of the cursor. The cursor is displayed
113 before the character with the given (base 0) index
114 in the widget. The value must be less than or
115 equal to the number of characters in the widget.
116 A value of -1 indicates that the position should
117 be set after the last character in the entry.
118 Note that this position is in characters, not in
122 <!-- ##### FUNCTION gtk_entry_get_text ##### -->
124 Retrieve the contents of the entry widget. The returned
125 pointer points to internally allocated storage in the
126 widget and must not be freed, modified or stored. For
127 this reason, this function is deprecated. Use
128 gtk_editable_get_chars() instead.
132 @Returns: the pointer the the contents of the text widget as a
136 <!-- ##### FUNCTION gtk_entry_select_region ##### -->
138 Selects a region of text. The characters that
139 are selected are those characters at positions from
140 @start_pos up to, but not including @end_pos. If
141 @end_pos is negative, then the the characters selected
142 will be those characters from @start_pos to the end
143 of the text. This function is obsolete. You should
144 use gtk_editable_select_region() instead.
148 @start: the starting position.
149 @end: the end position.
152 <!-- ##### FUNCTION gtk_entry_set_visibility ##### -->
154 Sets whether the contents of the entry are visible or
155 not. When visibility is set to %FALSE, characters
156 are displayed as asterisks (*'s), and will also appear
157 that way when the text in the entry widget is copied
162 @visible: %TRUE if the contents of the entry are displayd
166 <!-- ##### FUNCTION gtk_entry_set_editable ##### -->
168 Determines if the user can edit the text in the editable
169 widget or not. This function is obsolete. You should
170 use gtk_editable_set_editable() instead.
174 @editable: %TRUE if the user is allowed to edit the text
178 <!-- ##### FUNCTION gtk_entry_set_max_length ##### -->
180 Sets the maximum allowed length of the contents
181 of the widget. If the current contents are longer
182 than the given length, then they will be truncated
187 @max: the new maximum length.
190 <!-- ##### ARG GtkEntry:max_length ##### -->
192 Determines the maximum allowed length of the contents
193 of the widget. See gtk_entry_set_max_length().
196 <!-- ##### ARG GtkEntry:visibility ##### -->
198 Determines whether the contents of the entry widget
199 are visible or not. See gtk_entry_set_visibility().