1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.Entry</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="prev" href="class-gtkeditable.html" title="gtk.Editable"><link rel="next" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.Entry</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkeditable.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkentrycompletion.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkentry"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.Entry</h2><p>gtk.Entry — a single line text entry field.</p></div><div class="refsect1" lang="en"><a name="id3288115"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.Entry</span></span>(<span class="ooclass"><span class="classname"><a class="link" href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a></span></span>, <span class="ooclass"><span class="classname"><a class="link" href="class-gtkeditable.html" title="gtk.Editable">gtk.Editable</a></span></span>, <span class="ooclass"><span class="classname"><a class="link" href="class-gtkcelleditable.html" title="gtk.CellEditable">gtk.CellEditable</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gtkentry.html#constructor-gtkentry" title="Constructor">gtk.Entry</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>max</code></strong></span><span class="initializer">=0</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--set-visibility" title="gtk.Entry.set_visibility">set_visibility</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>visible</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--get-visibility" title="gtk.Entry.get_visibility">get_visibility</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--set-invisible-char" title="gtk.Entry.set_invisible_char">set_invisible_char</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>ch</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--get-invisible-char" title="gtk.Entry.get_invisible_char">get_invisible_char</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--set-has-frame" title="gtk.Entry.set_has_frame">set_has_frame</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>setting</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--get-has-frame" title="gtk.Entry.get_has_frame">get_has_frame</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--set-max-length" title="gtk.Entry.set_max_length">set_max_length</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>max</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--get-max-length" title="gtk.Entry.get_max_length">get_max_length</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--set-activates-default" title="gtk.Entry.set_activates_default">set_activates_default</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>setting</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--get-activates-default" title="gtk.Entry.get_activates_default">get_activates_default</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--set-width-chars" title="gtk.Entry.set_width_chars">set_width_chars</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>n_chars</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--get-width-chars" title="gtk.Entry.get_width_chars">get_width_chars</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--set-text" title="gtk.Entry.set_text">set_text</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>text</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--get-text" title="gtk.Entry.get_text">get_text</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--get-layout" title="gtk.Entry.get_layout">get_layout</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--get-layout-offsets" title="gtk.Entry.get_layout_offsets">get_layout_offsets</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--set-alignment" title="gtk.Entry.set_alignment">set_alignment</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>xalign</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--get-alignment" title="gtk.Entry.get_alignment">get_alignment</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--set-completion" title="gtk.Entry.set_completion">set_completion</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>width_chars</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--get-completion" title="gtk.Entry.get_completion">get_completion</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--set-inner-border" title="gtk.Entry.set_inner_border">set_inner_border</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>border</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--get-inner-border" title="gtk.Entry.get_inner_border">get_inner_border</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--set-cursor-hadjustment" title="gtk.Entry.set_cursor_hadjustment">set_cursor_hadjustment</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>adjustment</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentry.html#method-gtkentry--get-cursor-hadjustment" title="gtk.Entry.get_cursor_hadjustment">get_cursor_hadjustment</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3288759"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
+-- <a class="link" href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
+-- <a class="link" href="class-gtkentry.html" title="gtk.Entry">gtk.Entry</a>
</pre><div class="refsect1" lang="en"><a name="id3288796"></a><h2>Implemented Interfaces</h2><p>
<a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a>
implements
<a class="link" href="class-gtkbuildable.html" title="gtk.Buildable"><code class="classname">gtk.Buildable</code></a>
<a class="link" href="class-atkimplementor.html" title="atk.Implementor"><code class="classname">atk.ImplementorIFace</code></a>
<a class="link" href="class-gtkeditable.html" title="gtk.Editable"><code class="classname">gtk.Editable</code></a>
<a class="link" href="class-gtkcelleditable.html" title="gtk.CellEditable"><code class="classname">gtk.CellEditable</code></a>
</p></div></div><div class="refsect1" lang="en"><a name="properties-gtkentry"></a><h2>gtk.Entry Properties</h2><p><a class="link" href="class-gtkobject.html#properties-gtkobject" title="gtk.Object Properties">gtk.Object Properties</a></p><p><a class="link" href="class-gtkwidget.html#properties-gtkwidget" title="gtk.Widget Properties">gtk.Widget Properties</a></p><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"activates-default"</td><td valign="top">Read/Write</td><td valign="top">If <code class="literal">True</code> activate the default widget
(such as the default button in a dialog) when Enter is
pressed. Default value: <code class="literal">False</code>.</td></tr><tr valign="top"><td valign="top">"cursor-position"</td><td valign="top">Read</td><td valign="top">The current position of the insertion cursor as a
character index. Allowed values: [0,65535]. Default value:
0</td></tr><tr valign="top"><td valign="top">"editable"</td><td valign="top">Read/Write</td><td valign="top">If <code class="literal">True</code> the entry contents can be
edited. Default value: <code class="literal">True</code>.</td></tr><tr valign="top"><td valign="top">"has-frame"</td><td valign="top">Read/Write</td><td valign="top">If <code class="literal">False</code> removes outside bevel from
entry. Default value: <code class="literal">True</code>.</td></tr><tr valign="top"><td valign="top">"inner-border"</td><td valign="top">Read/Write</td><td valign="top">The text area's border between the text and the frame
as a gtkBorder. Available in GTK+ 2.10.</td></tr><tr valign="top"><td valign="top">"invisible-char"</td><td valign="top">Read/Write</td><td valign="top">The character to use when masking entry contents (when
"visibility" is <code class="literal">False</code>). Default value:
'*'.</td></tr><tr valign="top"><td valign="top">"max-length"</td><td valign="top">Read/Write</td><td valign="top">The maximum number of characters for this entry. Zero
if no maximum. Allowed values: [0,65535] Default value:
0.</td></tr><tr valign="top"><td valign="top">"scroll-offset"</td><td valign="top">Read</td><td valign="top">The number of pixels of the entry scrolled off the
screen to the left. Allowed values: >= 0 Default value:
0.</td></tr><tr valign="top"><td valign="top">"selection-bound"</td><td valign="top">Read</td><td valign="top">The position of the opposite end of the selection from
the cursor as a character index. Allowed values: [0,65535]
Default value: 0.</td></tr><tr valign="top"><td valign="top">"shadow-type"</td><td valign="top">Read/Write</td><td valign="top">Which kind of shadow to draw around the entry when
GtkEntry:has-frame is set to <code class="literal">True</code>.
Default value: gtk.SHADOW_IN
Available in GTK+ 2.12 and above.</td></tr><tr valign="top"><td valign="top">"text"</td><td valign="top">Read/Write</td><td valign="top">The contents of the entry. Default value: "".</td></tr><tr valign="top"><td valign="top">"truncate-multiline"</td><td valign="top">Read/Write</td><td valign="top">If <code class="literal">True</code>, pasted multi-line text is
truncated to the first line. Default value:
<code class="literal">False</code>. Available in GTK+ 2.10 and
above.</td></tr><tr valign="top"><td valign="top">"visibility"</td><td valign="top">Read/Write</td><td valign="top">If <code class="literal">False</code> displays the "invisible
char" instead of the actual text (e.g. password mode). Default
value: <code class="literal">True</code>.</td></tr><tr valign="top"><td valign="top">"width-chars"</td><td valign="top">Read/Write</td><td valign="top">The number of characters to leave space for in the
entry. Allowed values: >= -1. Default value: -1.</td></tr><tr valign="top"><td valign="top">"xalign"</td><td valign="top">Read/Write</td><td valign="top">The horizontal alignment ranging from 0.0 to 1.0
representing the fraction of freespace to the left (right for
RTL layouts) of the text. Available in GTK+ 2.4 and
above.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="style-properties-gtkentry"></a><h2>gtk.Entry Style Properties</h2><p><a class="link" href="class-gtkwidget.html#style-properties-gtkwidget" title="gtk.Widget Style Properties">gtk.Widget Style Properties</a></p><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"inner-border"</td><td valign="top">Read</td><td valign="top">Sets the text area's border between the text and the frame
This property is available in GTK+ 2.10 and above.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="signal-prototypes-gtkentry"></a><h2>gtk.Entry Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p><p><a class="link" href="class-gtkobject.html#signal-prototypes-gtkobject" title="gtk.Object Signal Prototypes">gtk.Object Signal Prototypes</a></p><p><a class="link" href="class-gtkwidget.html#signal-prototypes-gtkwidget" title="gtk.Widget Signal Prototypes">gtk.Widget Signal Prototypes</a></p><p><a class="link" href="class-gtkeditable.html#signal-prototypes-gtkeditable" title="gtk.Editable Signal Prototypes">gtk.Editable Signal Prototypes</a></p><p><a class="link" href="class-gtkcelleditable.html#signal-prototypes-gtkcelleditable" title="gtk.CellEditable Signal Prototypes">gtk.CellEditable Signal Prototypes</a></p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term">"<a class="link" href="class-gtkentry.html#signal-gtkentry--activate" title='The "activate" gtk.Entry Signal'>activate</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkentry.html#signal-gtkentry--backspace" title='The "backspace" gtk.Entry Signal'>backspace</a></span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkentry.html#signal-gtkentry--copy-clipboard" title='The "copy-clipboard" gtk.Entry Signal'>copy-clipboard</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkentry.html#signal-gtkentry--cut-clipboard" title='The "cut-clipboard" gtk.Entry Signal'>cut-clipboard</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkentry.html#signal-gtkentry--delete-from-cursor" title='The "delete-from-cursor" gtk.Entry Signal'>delete-from-cursor</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>delete_type</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>count</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkentry.html#signal-gtkentry--insert-at-cursor" title='The "insert-at-cursor" gtk.Entry Signal'>insert-at-cursor</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>string</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkentry.html#signal-gtkentry--move-cursor" title='The "move-cursor" gtk.Entry Signal'>move-cursor</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>step_size</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>count</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>extend_selection</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkentry.html#signal-gtkentry--paste-clipboard" title='The "paste-clipboard" gtk.Entry Signal'>paste-clipboard</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkentry.html#signal-gtkentry--populate-popup" title='The "populate-popup" gtk.Entry Signal'>populate-popup</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>menu</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkentry.html#signal-gtkentry--toggle-overwrite" title='The "toggle-overwrite" gtk.Entry Signal'>toggle-overwrite</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" lang="en"><a name="id3290170"></a><h2>Description</h2><p>The <a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a> widget
is a single line text entry widget. A fairly large set of key bindings
are supported by default. If the entered text is longer than the
allocation of the widget, the widget will scroll so that the cursor
position is visible.</p></div><div class="refsect1" lang="en"><a name="constructor-gtkentry"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.Entry</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>max</code></strong></span><span class="initializer">=0</span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>max</code></strong> :</span></p></td><td>the maximum length of the entry, or 0 for no
maximum. (other than the maximum length of entries.) The value passed in
will be limited to the range 0-65536.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a>.</td></tr></tbody></table><p>Creates a new <a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a> widget
with the maximum length specified by <em class="parameter"><code>max</code></em>.</p></div><div class="refsect1" lang="en"><a name="id3290299"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkentry--set-visibility"></a><h3>gtk.Entry.set_visibility</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_visibility</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>visible</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>visible</code></strong> :</span></p></td><td>If False the contents are obscured using the
"invisible-char"</td></tr></tbody></table><p>The <code class="methodname">set_visibility</code>() method sets the
"visibility" property to the value of
<em class="parameter"><code>visible</code></em>. If visible is <code class="literal">True</code>
the contents of the entry are displayed as plain text. If visible is
<code class="literal">False</code>, the contents are obscured by replacing the
characters with the invisible character (specified by the
"invisible-char" property). The characters will also be obscured when
the text in the entry widget is copied elsewhere. The default
invisible char is the asterisk '*', but it can be changed with <a class="link" href="class-gtkentry.html#method-gtkentry--set-invisible-char" title="gtk.Entry.set_invisible_char"><code class="methodname">set_invisible_char</code>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--get-visibility"></a><h3>gtk.Entry.get_visibility</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_visibility</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the text is
currently visible</td></tr></tbody></table><p>The <code class="methodname">get_visibility</code>() method retrieves
the value of the "visibility" property that determines whether the
text in <em class="parameter"><code>entry</code></em> is visible. See <a class="link" href="class-gtkentry.html#method-gtkentry--set-visibility" title="gtk.Entry.set_visibility"><code class="methodname">set_visibility</code>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--set-invisible-char"></a><h3>gtk.Entry.set_invisible_char</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_invisible_char</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>ch</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>ch</code></strong> :</span></p></td><td>a Unicode character</td></tr></tbody></table><p>The <code class="methodname">set_invisible_char</code>() method sets
the "invisible-char" property with the value of
<em class="parameter"><code>ch</code></em>. The "invisible-char" is the character to
use in place of the actual text when <a class="link" href="class-gtkentry.html#method-gtkentry--set-visibility" title="gtk.Entry.set_visibility"><code class="methodname">set_visibility</code>()</a>
has been called to set text visibility to
<code class="literal">False</code>. i.e. this is the character used in
"password mode" to show the user how many characters have been
typed. The default invisible character is an asterisk ('*'). If you
set the invisible character to 0, then the user will get no feedback
at all; there will be no text on the screen as they type.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--get-invisible-char"></a><h3>gtk.Entry.get_invisible_char</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_invisible_char</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the current invisible char, or 0, if the entry
does not show invisible text at all.</td></tr></tbody></table><p>The get_invisible_char() method retrieves the value of the
"invisible-char" property. The "invisible-char" is the character
displayed in place of the real characters for entries with visibility
set to <code class="literal">False</code>. See <a class="link" href="class-gtkentry.html#method-gtkentry--set-invisible-char" title="gtk.Entry.set_invisible_char"><code class="methodname">set_invisible_char</code>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--set-has-frame"></a><h3>gtk.Entry.set_has_frame</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_has_frame</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>setting</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>setting</code></strong> :</span></p></td><td>If True the entry is displayed with a beveled
frame around it.</td></tr></tbody></table><p>The <code class="methodname">set_has_frame</code>() method sets the
"has-frame" property to the value of <em class="parameter"><code>setting</code></em>.
If <em class="parameter"><code>setting</code></em> is <code class="literal">True</code> the entry
is displayed with a beveled frame around it.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--get-has-frame"></a><h3>gtk.Entry.get_has_frame</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_has_frame</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>whether the entry has a beveled
frame</td></tr></tbody></table><p>The <code class="methodname">get_has_frame</code>() method gets the
value of the "has-frame" property. If "has-frame" is
<code class="literal">True</code> the entry will be displayed with a beveled
frame around it.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--set-max-length"></a><h3>gtk.Entry.set_max_length</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_max_length</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>max</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>max</code></strong> :</span></p></td><td>the maximum length of the entry, or 0 for no
maximum. (other than the maximum length of entries.) The value
passed in will be clamped to the range
0-65536.</td></tr></tbody></table><p>The <code class="methodname">set_max_length</code>() method sets the
"max-length" property to the value of <em class="parameter"><code>max</code></em>. The
"max-length" property sets the maximum allowed length of the contents
of the widget. If the current contents are longer than the given
length, then they will be truncated to fit. If max is 0 then there is
no maximum length (other than 65536).</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--get-max-length"></a><h3>gtk.Entry.get_max_length</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_max_length</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the maximum allowed number of characters in
<a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a>, or 0
if there is no maximum.</td></tr></tbody></table><p>The <code class="methodname">get_max_length</code>() method retrieves
the value of the "max-length" property that specifies the maximum
allowed length of the text in the entry. See <a class="link" href="class-gtkentry.html#method-gtkentry--set-max-length" title="gtk.Entry.set_max_length"><code class="methodname">set_max_length</code>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--set-activates-default"></a><h3>gtk.Entry.set_activates_default</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_activates_default</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>setting</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>setting</code></strong> :</span></p></td><td>If <code class="literal">True</code> activate the
window's default widget on an <span class="keycap"><strong>Enter</strong></span>
key press</td></tr></tbody></table><p>The <code class="methodname">set_activates_default</code>() method sets
the "activates-default" property to the value of
<em class="parameter"><code>setting</code></em>. If <em class="parameter"><code>setting</code></em> is
<code class="literal">True</code>, pressing the <span class="keycap"><strong>Enter</strong></span> key in
the entry will activate the default widget for the window containing
the entry. This usually means that the dialog box containing the
entry will be closed, since the default widget is usually one of the
dialog buttons.</p><p>(For experts: if <em class="parameter"><code>setting</code></em> is
<code class="literal">True</code>, the entry calls <a class="link" href="class-gtkwindow.html#method-gtkwindow--activate-default" title="gtk.Window.activate_default"><code class="methodname">gtk.Window.activate_default</code>()</a>
on the window containing the entry, in the default handler for the
"activate" signal.)</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--get-activates-default"></a><h3>gtk.Entry.get_activates_default</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_activates_default</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the entry will
activate the default widget</td></tr></tbody></table><p>The <code class="methodname">get_activates_default</code>() method
retrieves the value of the "activates-default" property which is set
by <a class="link" href="class-gtkentry.html#method-gtkentry--set-activates-default" title="gtk.Entry.set_activates_default"><code class="methodname">set_activates_default</code>()</a>.
If "activates-default" is <code class="literal">True</code> pressing the
<span class="keycap"><strong>Enter</strong></span> key in the entry will activate the default
widget for the window containing the entry.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--set-width-chars"></a><h3>gtk.Entry.set_width_chars</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_width_chars</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>n_chars</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>n_chars</code></strong> :</span></p></td><td>width in chars</td></tr></tbody></table><p>The <code class="methodname">set_width_chars</code>() method sets the
"width-chars" property to the value of <em class="parameter"><code>n_char</code></em>.
Setting the "width-chars" property changes the size request of the
entry to be about the right size for <em class="parameter"><code>n_chars</code></em>
characters. Note that it only changes the size
<span class="emphasis"><em>request</em></span>, the size can still be affected by how
you pack the widget into containers. If <em class="parameter"><code>n_chars</code></em>
is -1, the size reverts to the default entry size.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--get-width-chars"></a><h3>gtk.Entry.get_width_chars</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_width_chars</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>number of chars to request space for, or
negative if unset</td></tr></tbody></table><p>The <code class="methodname">get_width_chars</code>() method gets the
value of the "width-chars" property which is set by the <a class="link" href="class-gtkentry.html#method-gtkentry--set-width-chars" title="gtk.Entry.set_width_chars"><code class="methodname">set_width_chars</code>()</a>
method.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--set-text"></a><h3>gtk.Entry.set_text</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_text</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>text</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>text</code></strong> :</span></p></td><td>a string to use as the new contents of the
entry</td></tr></tbody></table><p>The <code class="methodname">set_text</code>() method sets the "text"
property to the value of <em class="parameter"><code>text</code></em>. The string in
<em class="parameter"><code>text</code></em> replaces the current contents of the
entry.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--get-text"></a><h3>gtk.Entry.get_text</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_text</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the contents of the entry as a
string</td></tr></tbody></table><p>The <code class="methodname">get_text</code>() method returns the value
of the "text" property which is a string containing the contents of
the entry.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--get-layout"></a><h3>gtk.Entry.get_layout</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_layout</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a> for
this entry</td></tr></tbody></table><p>The <code class="methodname">get_layout</code>() method gets the <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a>
used to display the entry. The layout is useful to e.g. convert text
positions to pixel positions, in combination with <a class="link" href="class-gtkentry.html#method-gtkentry--get-layout-offsets" title="gtk.Entry.get_layout_offsets"><code class="methodname">get_layout_offsets</code>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--get-layout-offsets"></a><h3>gtk.Entry.get_layout_offsets</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_layout_offsets</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a tuple containing the X and Y offsets of the
pango layout</td></tr></tbody></table><p>The <code class="methodname">get_layout_offsets</code>() method obtains
the position of the <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a>
used to render text in the entry, in widget coordinates and returns it
as a tuple. This method is used to line up the text in an entry with
some other text, e.g. when using the entry to implement editable cells
in a sheet widget. It is also useful to convert mouse events into
coordinates inside the <a class="link" href="class-pangolayout.html" title="pango.Layout"><code class="classname">pango.Layout</code></a>,
e.g. to take some action if some part of the entry text is
clicked.</p><p>Note that as the user scrolls around in the entry the offsets
will change; you'll need to connect to the "notify::scroll_offset"
signal to track this.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--set-alignment"></a><h3>gtk.Entry.set_alignment</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_alignment</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>xalign</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>xalign</code></strong> :</span></p></td><td>The horizontal alignment ranging from 0.0 to
1.0 representing the freespace to the left (right for RTL layouts)
of the text.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_alignment</code>() method sets the
"xalign" property to the value of <em class="parameter"><code>xalign</code></em>. The
alignment controls the horizontal positioning of the contents when the
displayed text is shorter than the width of the entry. The value of
<em class="parameter"><code>xalign</code></em> is the fraction of freespace to the left
(right in RTL layouts) of the text.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--get-alignment"></a><h3>gtk.Entry.get_alignment</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_alignment</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The horizontal alignment ranging from 0.0 to
1.0 representing the freespace to the left (right for RTL layouts)
of the text.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_alignment</code>() method returns the
value of the "xalign" property which is the fraction of freespace (if
any) to the left (right in RTL layouts) of the text.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--set-completion"></a><h3>gtk.Entry.set_completion</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_completion</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>completion</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>completion</code></strong> :</span></p></td><td>a <a class="link" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"><code class="classname">gtk.EntryCompletion</code></a></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_completion</code>() method sets the
<a class="link" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"><code class="classname">gtk.EntryCompletion</code></a>
specified by <em class="parameter"><code>completion</code></em> to be the auxiliary
completion object to use with the entry. All further configuration of
the completion mechanism is done using
<em class="parameter"><code>completion</code></em> and the <a class="link" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"><code class="classname">gtk.EntryCompletion</code></a>
methods.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--get-completion"></a><h3>gtk.Entry.get_completion</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_completion</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the auxiliary completion object</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_completion</code>() method returns the
<a class="link" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"><code class="classname">gtk.EntryCompletion</code></a>
object currently in use by the entry.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--set-inner-border"></a><h3>gtk.Entry.set_inner_border</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_inner_border</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>border</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>border</code></strong> :</span></p></td><td>a <a class="link" href="class-gtkborder.html" title="gtk.Border"><code class="classname">gtk.Border</code></a>,
or <code class="literal">None</code></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.10 and above.</p></div><p>The <code class="methodname">set_inner_border</code>() method sets the
entry's "inner-border" property to the value specified by
<em class="parameter"><code>border</code></em>, or clears it if <code class="literal">None</code>
is passed. The "inner-border" is the area around the entry's text, but
inside its frame.</p><p>If set, this property overrides the inner-border style property.
Overriding the style-provided border is useful when you want to do
in-place editing of some text in a canvas or list widget, where
pixel-exact positioning of the entry is important.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--get-inner-border"></a><h3>gtk.Entry.get_inner_border</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_inner_border</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the entry's <a class="link" href="class-gtkborder.html" title="gtk.Border"><code class="classname">gtk.Border</code></a>,
or <code class="literal">None</code> if none was set.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.10 and above.</p></div><p>The <code class="methodname">get_inner_border</code>() method returns
the value of the entry's "inner-border" property. See <a class="link" href="class-gtkentry.html#method-gtkentry--set-inner-border" title="gtk.Entry.set_inner_border"><code class="methodname">set_inner_border</code>()</a>
for more information.</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--set-cursor-hadjustment"></a><h3>gtk.Entry.set_cursor_hadjustment</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_cursor_hadjustment</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>adjustment</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>adjustment</code></strong> :</span></p></td><td>An adjustment which should be adjusted when
the cursor is moved, or <code class="literal">None</code>.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.12 and above.</p></div><p>
The <code class="methodname">set_cursor_hadjustment</code>() method hooks up an adjustment
to the cursor position in an entry, so that when the cursor is moved, the adjustment
is scrolled to show that position. See
<a class="link" href="class-gtkscrolledwindow.html#method-gtkscrolledwindow--get-hadjustment" title="gtk.ScrolledWindow.get_hadjustment">gtk.ScrolledWindow.get_hadjustment</a>
for a typical way of obtaining the adjustment.
The adjustment has to be in pixel units and in the same coordinate system as the entry.
</p></div><div class="refsect2" lang="en"><a name="method-gtkentry--get-cursor-hadjustment"></a><h3>gtk.Entry.get_cursor_hadjustment</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_cursor_hadjustment</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The horizontal cursor adjustment, or
<code class="literal">None</code> if none has been set.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.12 and above.</p></div><p>
The <code class="methodname">get_cursor_hadjustment</code>() method retrieves the horizontal
cursor adjustment for the entry. See
<a class="link" href="class-gtkentry.html#method-gtkentry--set-cursor-hadjustment" title="gtk.Entry.set_cursor_hadjustment">set_cursor_hadjustment</a>.
</p></div></div><div class="refsect1" lang="en"><a name="id3292437"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtkentry--activate"></a><h3>The "activate" gtk.Entry Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em> :</span></p></td><td>the entry that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "activate" signal is emitted when the entry is activated
either by user action (pressing the <span class="keycap"><strong>Enter</strong></span> key) or
programmatically with the <a class="link" href="class-gtkwidget.html#method-gtkwidget--activate" title="gtk.Widget.activate"><code class="methodname">gtk.Widget.activate</code>()</a>
method</p></div><div class="refsect2" lang="en"><a name="signal-gtkentry--backspace"></a><h3>The "backspace" gtk.Entry Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em> :</span></p></td><td>the object which received the signal.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if any)</td></tr></tbody></table><p>The "backspace" signal is emitted when the
<span class="keysym">Backspace</span> key is entered from the keyboard.</p></div><div class="refsect2" lang="en"><a name="signal-gtkentry--copy-clipboard"></a><h3>The "copy-clipboard" gtk.Entry Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em> :</span></p></td><td>the entry that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "copy-clipboard" signal is emitted when the selection text
in the entry is copied to the clipboard.</p></div><div class="refsect2" lang="en"><a name="signal-gtkentry--cut-clipboard"></a><h3>The "cut-clipboard" gtk.Entry Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em> :</span></p></td><td>the entry that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "cut-clipboard" signal is emitted when the selection in the
entry is cut (removed from the entry) and placed in the
clipboard.</p></div><div class="refsect2" lang="en"><a name="signal-gtkentry--delete-from-cursor"></a><h3>The "delete-from-cursor" gtk.Entry Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>delete_type</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>count</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em> :</span></p></td><td>the entry that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>delete_type</code></em> :</span></p></td><td>the type of deletion</td></tr><tr><td><p><span class="term"><em class="parameter"><code>count</code></em> :</span></p></td><td>the number of deletions of the type to
perform</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "delete-from-cursor" signal is emitted when the a deletion
from the cursor i.e. removal o text at the cursor position, either
before it (negative <em class="parameter"><code>count</code></em>) or after it
(positive <em class="parameter"><code>count</code></em>). The value of
<em class="parameter"><code>delete_type</code></em> can be one of:</p><div class="itemizedlist"><ul type="disc"><li>gtk.DELETE_CHARS</li><li>gtk.DELETE_WORD_ENDS</li><li> gtk.DELETE_WORDS</li><li> gtk.DELETE_DISPLAY_LINES</li><li> gtk.DELETE_DISPLAY_LINE_ENDS</li><li> gtk.DELETE_PARAGRAPH_ENDS</li><li> gtk.DELETE_PARAGRAPHS</li><li> gtk.DELETE_WHITESPACE</li></ul></div></div><div class="refsect2" lang="en"><a name="signal-gtkentry--insert-at-cursor"></a><h3>The "insert-at-cursor" gtk.Entry Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>string</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em> :</span></p></td><td>the entry that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td><td>the text being inserted in the
entry</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "insert-at-cursor" signal is emitted when text is being
inserted in the entry.</p></div><div class="refsect2" lang="en"><a name="signal-gtkentry--move-cursor"></a><h3>The "move-cursor" gtk.Entry Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>step</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>count</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>extend_selection</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em> :</span></p></td><td>the entry that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>step</code></em> :</span></p></td><td>the size of the step to move the
cursor</td></tr><tr><td><p><span class="term"><em class="parameter"><code>count</code></em> :</span></p></td><td>the number of steps to move the
cursor</td></tr><tr><td><p><span class="term"><em class="parameter"><code>extend_selection</code></em> :</span></p></td><td>if True extend the selection as well as moving
the cursor</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "move-cursor" signal is emitted when the cursor is being
moved by <em class="parameter"><code>count</code></em> steps of size
<em class="parameter"><code>step</code></em>. If
<em class="parameter"><code>extend_selection</code></em> is <code class="literal">True</code> the
selection is extended as the cursor is being moved. The value of
<em class="parameter"><code>step</code></em> can be one of:</p><div class="itemizedlist"><ul type="disc"><li>gtk.MOVEMENT_LOGICAL_POSITIONS</li><li>gtk.MOVEMENT_VISUAL_POSITIONS</li><li> gtk.MOVEMENT_WORDS</li><li> gtk.MOVEMENT_DISPLAY_LINES</li><li> gtk.MOVEMENT_DISPLAY_LINE_ENDS</li><li> gtk.MOVEMENT_PARAGRAPH_ENDS</li><li> gtk.MOVEMENT_PARAGRAPHS</li><li> gtk.MOVEMENT_PAGES</li><li> gtk.MOVEMENT_BUFFER_ENDS</li></ul></div></div><div class="refsect2" lang="en"><a name="signal-gtkentry--paste-clipboard"></a><h3>The "paste-clipboard" gtk.Entry Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em> :</span></p></td><td>the entry that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "paste-clipboard" signal is emitted when the contents of the
clipboard are pasted into the entry.</p></div><div class="refsect2" lang="en"><a name="signal-gtkentry--populate-popup"></a><h3>The "populate-popup" gtk.Entry Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>menu</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em> :</span></p></td><td>the entry that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td><td>the menu that needs
populating</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "populate-popup" signal is emitted when the
<em class="parameter"><code>menu</code></em> needs populating.</p></div><div class="refsect2" lang="en"><a name="signal-gtkentry--toggle-overwrite"></a><h3>The "toggle-overwrite" gtk.Entry Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>entry</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em> :</span></p></td><td>the entry that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "toggle-overwrite" signal is emitted when the internal entry
attribute "overwrite_mode" is toggled by pressing the
<span class="keycap"><strong>Insert</strong></span> key.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtkeditable.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gtkentrycompletion.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Editable </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.EntryCompletion</td></tr></table></div></body></html>
|