/usr/share/gtk-doc/html/pygtk/class-gtkentrycompletion.html is in python-gtk2-doc 2.24.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.EntryCompletion</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" 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-gtkentrybuffer.html" title="gtk.EntryBuffer"><link rel="next" href="class-gtkeventbox.html" title="gtk.EventBox"></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.EntryCompletion</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkentrybuffer.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkeventbox.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.EntryCompletion"><a name="class-gtkentrycompletion"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.EntryCompletion</h2><p>gtk.EntryCompletion — completion
functionality for <a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a> (new in
PyGTK 2.4)</p></div><div class="refsect1" title="Synopsis"><a name="id3689714"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.EntryCompletion</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>, <span class="ooclass"><span class="classname"><a class="link" href="class-gtkcelllayout.html" title="gtk.CellLayout">gtk.CellLayout</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#constructor-gtkentrycompletion" title="Constructor">gtk.EntryCompletion</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--get-entry" title="gtk.EntryCompletion.get_entry">get_entry</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-model" title="gtk.EntryCompletion.set_model">set_model</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>model</code></strong></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--get-model" title="gtk.EntryCompletion.get_model">get_model</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-match-func" title="gtk.EntryCompletion.set_match_func">set_match_func</a></span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>func</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>func_data</code></em></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-minimum-key-length" title="gtk.EntryCompletion.set_minimum_key_length">set_minimum_key_length</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>length</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--get-minimum-key-length" title="gtk.EntryCompletion.get_minimum_key_length">get_minimum_key_length</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--complete" title="gtk.EntryCompletion.complete">complete</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--insert-action-text" title="gtk.EntryCompletion.insert_action_text">insert_action_text</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></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-gtkentrycompletion.html#method-gtkentrycompletion--insert-action-markup" title="gtk.EntryCompletion.insert_action_markup">insert_action_markup</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>markup</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--delete-action" title="gtk.EntryCompletion.delete_action">delete_action</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--insert-prefix" title="gtk.EntryCompletion.insert_prefix">insert_prefix</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-text-column" title="gtk.EntryCompletion.set_text_column">set_text_column</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>column</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--get-text-column" title="gtk.EntryCompletion.get_text_column">get_text_column</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-inline-completion" title="gtk.EntryCompletion.set_inline_completion">set_inline_completion</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>inline_completion</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--get-inline-completion" title="gtk.EntryCompletion.get_inline_completion">get_inline_completion</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-inline-completion" title="gtk.EntryCompletion.set_inline_completion">set_inline_selection</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>inline_selection</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--get-inline-completion" title="gtk.EntryCompletion.get_inline_completion">get_inline_selection</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-popup-completion" title="gtk.EntryCompletion.set_popup_completion">set_popup_completion</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>popup_completion</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--get-popup-completion" title="gtk.EntryCompletion.get_popup_completion">get_popup_completion</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-popup-set-width" title="gtk.EntryCompletion.set_popup_set_width">set_popup_set_width</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>popup_set_width</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--get-popup-set-width" title="gtk.EntryCompletion.get_popup_set_width">get_popup_set_width</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-popup-single-match" title="gtk.EntryCompletion.set_popup_single_match">set_popup_single_match</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>popup_single_match</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--get-popup-single-match" title="gtk.EntryCompletion.get_popup_completion">get_popup_single_match</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--get-completion-prefix" title="gtk.EntryCompletion.get_completion_prefix">get_completion_prefix</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="Ancestry"><a name="id3690395"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion">gtk.EntryCompletion</a>
</pre></div><div class="refsect1" title="Implemented Interfaces"><a name="id3690421"></a><h2>Implemented Interfaces</h2><p>
<a class="link" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"><code class="classname">gtk.EntryCompletion</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-gtkcelllayout.html" title="gtk.CellLayout"><code class="classname">gtk.CellLayout</code></a>
</p></div><div class="refsect1" title="gtk.EntryCompletion Properties"><a name="properties-gtkentrycompletion"></a><h2>gtk.EntryCompletion Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col width="1in"><col width="1in"><col width="4in"></colgroup><tbody><tr valign="top"><td valign="top">"inline-completion"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code> the common prefix should be
inserted automatically. Default value:
<code class="literal">False</code>. Available in GTK+ 2.6 and
above.</td></tr><tr valign="top"><td valign="top">"inline-selection"</td><td valign="top">Read-Write</td><td valign="top">Determines whether the possible completions on the popup will appear
in the entry as you navigate through them.
Default value: <code class="literal">False</code>. Available in GTK+ 2.12 and above.</td></tr><tr valign="top"><td valign="top">"minimum-key-length"</td><td valign="top">Read-Write</td><td valign="top">Minimum length of the search key in order to look up
matches. Allowed values >= 0. Default value: 1</td></tr><tr valign="top"><td valign="top">"model"</td><td valign="top">Read-Write</td><td valign="top">The <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
to find matches in.</td></tr><tr valign="top"><td valign="top">"popup-completion"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code> the completions should be
shown in a popup window. Default value:
<code class="literal">True</code>. Available in GTK+ 2.6 and
above.</td></tr><tr valign="top"><td valign="top">"popup-set-width"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code> the completions popup window
will be resized to the width of the entry. Default value:
<code class="literal">True</code>. Available in GTK+ 2.8 and
above.</td></tr><tr valign="top"><td valign="top">"popup-single-match"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code> the completions popup window
will be for a single possible completion. Default value:
<code class="literal">True</code>. Available in GTK+ 2.8 and
above.</td></tr><tr valign="top"><td valign="top">"text-column"</td><td valign="top">Read-Write</td><td valign="top">The column of the model containing the strings. Allowed
values: >= -1. Default value: -1. Available in GTK+ 2.6 and
above.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.EntryCompletion Signal Prototypes"><a name="signal-prototypes-gtkentrycompletion"></a><h2>gtk.EntryCompletion Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></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-gtkentrycompletion.html#signal-gtkentrycompletion--action-activated" title='The "action-activated" gtk.EntryCompletion Signal'>action-activated</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>completion</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>index</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-gtkentrycompletion.html#signal-gtkentrycompletion--cursor-on-match" title='The "cursor-on-match" gtk.EntryCompletion Signal'>cursor-on-match</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>completion</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>model</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>iter</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-gtkentrycompletion.html#signal-gtkentrycompletion--insert-prefix" title='The "insert-prefix" gtk.EntryCompletion Signal'>insert-prefix</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>completion</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>prefix</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-gtkentrycompletion.html#signal-gtkentrycompletion--match-selected" title='The "match-selected" gtk.EntryCompletion Signal'>match-selected</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>completion</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>model</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>iter</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" title="Description"><a name="id3691067"></a><h2>Description</h2><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This widget is available in PyGTK 2.4 and above.</p></div><p><a class="link" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"><code class="classname">gtk.EntryCompletion</code></a>
is an auxiliary object to be used in conjunction with <a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a> to
provide completion functionality. It implements the <a class="link" href="class-gtkcelllayout.html" title="gtk.CellLayout"><code class="classname">gtk.CellLayout</code></a>
interface, to allow the user to add extra cells to the popup display of
completions.</p><p>To add completion functionality to an entry, use the <a class="link" href="class-gtkentry.html#method-gtkentry--set-completion" title="gtk.Entry.set_completion"><code class="methodname">gtk.Entry.set_completion</code>()</a>
method. In addition to regular completion matches, that will be
inserted into the entry when they are selected, <a class="link" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"><code class="classname">gtk.EntryCompletion</code></a>
also allows "actions" to be displayed in the popup window below any
completions. Their appearance is similar to menuitems, to differentiate
them clearly from completion strings. When an action is selected, the
"action-activated" signal is emitted.</p><p>When the user selects a completion, the content of the entry is updated.
By default, the content of the entry is replaced by the text column of the model,
but this can be overridden by connecting to the "match-selected" signal and
updating the entry in the signal handler. Note that you should return
<code class="literal">True</code> from the signal handler to suppress the default behaviour.</p><p>A <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
(e.g. a <a class="link" href="class-gtkliststore.html" title="gtk.ListStore"><code class="classname">gtk.ListStore</code></a>)
containing the completion strings is associated with the <a class="link" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"><code class="classname">gtk.EntryCompletion</code></a>
using the <a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-model" title="gtk.EntryCompletion.set_model"><code class="methodname">set_model</code>()</a>
method. The tree model column containing the completion strings can be
set using the convenience method <a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-text-column" title="gtk.EntryCompletion.set_text_column"><code class="methodname">set_text_column</code>()</a>
that also creates a <a class="link" href="class-gtkcellrenderertext.html" title="gtk.CellRendererText"><code class="classname">gtk.CellRendererText</code></a>
and packs it into the entry completion.</p><p>Otherwise, you can create <a class="link" href="class-gtkcellrenderer.html" title="gtk.CellRenderer"><code class="classname">gtk.CellRenderer</code></a>
objects and pack them into the <a class="link" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"><code class="classname">gtk.EntryCompletion</code></a>
using the <a class="link" href="class-gtkcelllayout.html" title="gtk.CellLayout"><code class="classname">gtk.CellLayout</code></a>
methods <a class="link" href="class-gtkcelllayout.html#method-gtkcelllayout--pack-start" title="gtk.CellLayout.pack_start"><code class="methodname">gtk.CellLayout.pack_start</code>()</a>
or <a class="link" href="class-gtkcelllayout.html#method-gtkcelllayout--pack-start" title="gtk.CellLayout.pack_start"><code class="methodname">gtk.CellLayout.pack_start</code>()</a>. However,
you will also have to define a match function and set it with the <a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-match-func" title="gtk.EntryCompletion.set_match_func"><code class="methodname">set_match_func</code>()</a>
method.</p><p>If you wanted to create a completion list with the strings to
insert and some additional info e.g. an icon or description you could do
something like:</p><pre class="programlisting">
entry = gtk.Entry()
completion = gtk.EntryCompletion()
entry.set_completion(completion)
liststore = gtk.ListStore(gobject.TYPE_STRING, gtk.gdk.Pixbuf)
completion.set_model(liststore)
pixbufcell = gtk.CellRendererPixbuf()
completion.pack_start(pixbufcell)
completion.add_attribute(pixbufcell, 'pixbuf', 1)
# create a gtk.CellRendererText and pack it in the completion. Also set the
# 'text' attribute
completion.set_text_column(0)
# load up the liststore with string - pixbuf data - assuming pixbuf created
liststore.append(['string text', pixbuf])
</pre><p>This will create an entry that will display a pixbuf and the text
string during completion.</p><p>Actions are easily managed using the <a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--insert-action-text" title="gtk.EntryCompletion.insert_action_text"><code class="methodname">insert_action_text</code>()</a>,
<a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--insert-action-markup" title="gtk.EntryCompletion.insert_action_markup"><code class="methodname">insert_action_markup</code>()</a>
and <a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--delete-action" title="gtk.EntryCompletion.delete_action"><code class="methodname">delete_action</code>()</a>
methods.</p></div><div class="refsect1" title="Constructor"><a name="constructor-gtkentrycompletion"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.EntryCompletion</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 newly created <a class="link" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"><code class="classname">gtk.EntryCompletion</code></a> object.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This constructor is available in PyGTK 2.4 and above.</p></div><p>Creates a new <a class="link" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"><code class="classname">gtk.EntryCompletion</code></a>
object.</p></div><div class="refsect1" title="Methods"><a name="id3691401"></a><h2>Methods</h2><div class="refsect2" title="gtk.EntryCompletion.get_entry"><a name="method-gtkentrycompletion--get-entry"></a><h3>gtk.EntryCompletion.get_entry</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_entry</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-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a>
that the completion is attached to.</td></tr></tbody></table><div class="note" title="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_entry</code>() method retrieves the
<a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a> that
the entry completion is attached to.</p></div><div class="refsect2" title="gtk.EntryCompletion.set_model"><a name="method-gtkentrycompletion--set-model"></a><h3>gtk.EntryCompletion.set_model</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_model</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>model</code></strong></span><span class="initializer">=None</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>model</code></strong> :</span></p></td><td>The <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
to use with the entry completion.</td></tr></tbody></table><div class="note" title="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_model</code>() method sets the <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
specified by <em class="parameter"><code>model</code></em> to be used with the entry
completion. A previously set model will be removed before the new model
is set. If <em class="parameter"><code>model</code></em> is <code class="literal">None</code> or not
specified, the old model will be unset.</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>In PyGTK 2.4.0 the model could not be <code class="literal">None</code>
and did not default to <code class="literal">None</code>.</p></div></div><div class="refsect2" title="gtk.EntryCompletion.get_model"><a name="method-gtkentrycompletion--get-model"></a><h3>gtk.EntryCompletion.get_model</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_model</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 <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>,
or <code class="literal">None</code> if not set.</td></tr></tbody></table><div class="note" title="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_model</code>() method returns the
<a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
that the entry completion is using as data source. Returns
<code class="literal">None</code> if the model is unset.</p></div><div class="refsect2" title="gtk.EntryCompletion.set_match_func"><a name="method-gtkentrycompletion--set-match-func"></a><h3>gtk.EntryCompletion.set_match_func</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_match_func</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>func</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>func_data</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>func</code></em> :</span></p></td><td>A function to be used.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>func_data</code></em> :</span></p></td><td>The user data for <em class="parameter"><code>func</code></em>.</td></tr></tbody></table><div class="note" title="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_match_func</code>() method sets the
match function specified by <em class="parameter"><code>func</code></em>. The match function
is used by the entry completion to determine if a row of the associated tree
model should be in the completion list.</p><p>The signature of the match function is:</p><pre class="programlisting">
def match_func(completion, key_string, iter, func_data):
</pre><p>where <em class="parameter"><code>completion</code></em> is the <a class="link" href="class-gtkentrycompletion.html" title="gtk.EntryCompletion"><code class="classname">gtk.EntryCompletion</code></a>
that the match function is invoked on, <em class="parameter"><code>key_string</code></em> is
the current contents of the <a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a> to be
matched, <em class="parameter"><code>iter</code></em> is a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing at a row in the <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
associated with completion and <em class="parameter"><code>func_data</code></em> is the data
specified when the <a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-match-func" title="gtk.EntryCompletion.set_match_func"><code class="methodname">set_match_func</code>()</a>
method was called. The match function should return <code class="literal">True</code>
if the completion string should be displayed; otherwise,
<code class="literal">False</code>.</p><p>A simple example match function is:</p><pre class="programlisting">
# Assumes that the func_data is set to the number of the text column in the
# model.
def match_func(completion, key, iter, column):
model = completion.get_model()
text = model.get_value(iter, column)
if text.startswith(key):
return True
return False
</pre><p>You must use the <a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-match-func" title="gtk.EntryCompletion.set_match_func"><code class="methodname">set_match_func</code>()</a>
method to display completions if you don't use the <a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-text-column" title="gtk.EntryCompletion.set_text_column"><code class="methodname">set_text_column</code>()</a>
method.</p></div><div class="refsect2" title="gtk.EntryCompletion.set_minimum_key_length"><a name="method-gtkentrycompletion--set-minimum-key-length"></a><h3>gtk.EntryCompletion.set_minimum_key_length</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_minimum_key_length</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>length</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>length</code></strong> :</span></p></td><td>The minimum length of the key string in order
to start completing.</td></tr></tbody></table><div class="note" title="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_minimum_key_length</code>() method
sets the minimum length of the search key to the value specified by
<em class="parameter"><code>length</code></em>. This means that the key string (contents of
the <a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a>)
must be at least <em class="parameter"><code>length</code></em> characters before a
completion list will be displayed. This is useful for long lists, where
completing using a small key will take too much time and will likely return
too large a dataset.</p></div><div class="refsect2" title="gtk.EntryCompletion.get_minimum_key_length"><a name="method-gtkentrycompletion--get-minimum-key-length"></a><h3>gtk.EntryCompletion.get_minimum_key_length</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_minimum_key_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 currently used minimum key
length.</td></tr></tbody></table><div class="note" title="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_minimum_key_length</code>() method
returns the minimum key length set for the entry completion. See the
<a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-minimum-key-length" title="gtk.EntryCompletion.set_minimum_key_length"><code class="methodname">set_minimum_key_length</code>()</a>
method for more information.</p></div><div class="refsect2" title="gtk.EntryCompletion.complete"><a name="method-gtkentrycompletion--complete"></a><h3>gtk.EntryCompletion.complete</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">complete</span>(<span class="methodparam"></span>)</code></pre><div class="note" title="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">complete</code>() method requests a
completion operation, i.e. a refiltering of the current list
with completions, using the current key. The completion list view will be
updated accordingly.</p></div><div class="refsect2" title="gtk.EntryCompletion.insert_action_text"><a name="method-gtkentrycompletion--insert-action-text"></a><h3>gtk.EntryCompletion.insert_action_text</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">insert_action_text</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></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>index</code></strong> :</span></p></td><td>The index in the action list where the item
should be inserted.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>text</code></strong> :</span></p></td><td>The text of the item to
insert.</td></tr></tbody></table><div class="note" title="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">insert_action_text</code>() method inserts
an action in the action item list of the entry completion at the position
specified by <em class="parameter"><code>index</code></em> with the text specified by
<em class="parameter"><code>text</code></em>. If you want the action item to have markup, use
the <a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--insert-action-markup" title="gtk.EntryCompletion.insert_action_markup"><code class="methodname">gtk.EntryCompletion.insert_action_markup()</code></a>
method.</p></div><div class="refsect2" title="gtk.EntryCompletion.insert_action_markup"><a name="method-gtkentrycompletion--insert-action-markup"></a><h3>gtk.EntryCompletion.insert_action_markup</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">insert_action_markup</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>markup</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>index</code></strong> :</span></p></td><td>The index in the action list where the item
should be inserted.</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>markup</code></strong> :</span></p></td><td>The Pango markup of the item to
insert.</td></tr></tbody></table><div class="note" title="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">insert_action_markup</code>() method
inserts an action item in the action item list of the entry completion at
the position specified by <em class="parameter"><code>index</code></em> with the Pango markup
specified by <em class="parameter"><code>markup</code></em>.</p></div><div class="refsect2" title="gtk.EntryCompletion.delete_action"><a name="method-gtkentrycompletion--delete-action"></a><h3>gtk.EntryCompletion.delete_action</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">delete_action</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>index</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>index</code></strong> :</span></p></td><td>The index of the item to
delete.</td></tr></tbody></table><div class="note" title="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">delete_action</code>() method deletes the
action item at the position in the action item list specified by
<em class="parameter"><code>index</code></em>.</p></div><div class="refsect2" title="gtk.EntryCompletion.insert_prefix"><a name="method-gtkentrycompletion--insert-prefix"></a><h3>gtk.EntryCompletion.insert_prefix</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">insert_prefix</span>()</code></pre><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <code class="methodname">insert_prefix</code>() method requests a
prefix insertion.</p></div><div class="refsect2" title="gtk.EntryCompletion.set_text_column"><a name="method-gtkentrycompletion--set-text-column"></a><h3>gtk.EntryCompletion.set_text_column</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_text_column</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>column</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>column</code></strong> :</span></p></td><td>The column in the model to get strings
from.</td></tr></tbody></table><div class="note" title="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_text_column</code>() method is a
convenience method for setting up the most common completion scenario: a
completion list with just strings. This method creates and adds a <a class="link" href="class-gtkcellrenderertext.html" title="gtk.CellRendererText"><code class="classname">gtk.CellRendererText</code></a>
using the column specified by <em class="parameter"><code>column</code></em> as the source
for completion strings. If you don't use this method you will have to
install a <a class="link" href="class-gtkcellrenderertext.html" title="gtk.CellRendererText"><code class="classname">gtk.CellRendererText</code></a>
in the entry completion and set a match function using the <a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-match-func" title="gtk.EntryCompletion.set_match_func"><code class="methodname">set_match_func</code>()</a>
method to display the completion strings. In GTK+ 2.6 the "text-column"
property is set to the value of <em class="parameter"><code>column</code></em>.</p></div><div class="refsect2" title="gtk.EntryCompletion.get_text_column"><a name="method-gtkentrycompletion--get-text-column"></a><h3>gtk.EntryCompletion.get_text_column</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_text_column</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 column containing the text
strings.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">get_text_column</code>() method returns
the value of the "text-column" property. The "text-column" property contains
the index of the column in the completion model to get strings from. See the
<a class="link" href="class-gtkentrycompletion.html#method-gtkentrycompletion--set-text-column" title="gtk.EntryCompletion.set_text_column"><code class="methodname">set_text_column</code>()</a>
method for more information.</p></div><div class="refsect2" title="gtk.EntryCompletion.set_inline_completion"><a name="method-gtkentrycompletion--set-inline-completion"></a><h3>gtk.EntryCompletion.set_inline_completion</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_inline_completion</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>inline_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>inline_completion</code></strong> :</span></p></td><td>if <code class="literal">True</code> do inline
completion</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <code class="methodname">set_inline_completion</code>() method sets
the "inline-completion" property to the value of
<em class="parameter"><code>inline_completion</code></em>. If
<em class="parameter"><code>inline_completion</code></em> is <code class="literal">True</code>, the
common prefix of the possible completions should be automatically inserted
in the entry.</p></div><div class="refsect2" title="gtk.EntryCompletion.get_inline_completion"><a name="method-gtkentrycompletion--get-inline-completion"></a><h3>gtk.EntryCompletion.get_inline_completion</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_inline_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><code class="literal">True</code> if automatic inline
completion is enabled.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <code class="methodname">get_inline_completion</code>() method
returns the value of the "inline-completion" property. If the value of the
"inline-completion" property is <code class="literal">True</code> the common prefix of
possible completions is automatically inserted in the entry.</p></div><div class="refsect2" title="gtk.EntryCompletion.set_inline_selection"><a name="method-gtkentrycompletion--set-inline-selection"></a><h3>gtk.EntryCompletion.set_inline_selection</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_inline_selection</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>inline_selection</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>inline_selection</code></strong> :</span></p></td><td>if <code class="literal">True</code> do inline
selection</td></tr></tbody></table><div class="note" title="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_inline_selection</code>() method Sets whether
it is possible to cycle through the possible completions inside the entry.</p></div><div class="refsect2" title="gtk.EntryCompletion.get_inline_selection"><a name="method-gtkentrycompletion--get-inline-selection"></a><h3>gtk.EntryCompletion.get_inline_selection</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_inline_selection</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 automatic inline
selection is enabled.</td></tr></tbody></table><div class="note" title="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_inline_selection</code>() method returns
<code class="literal">True</code> if inline-selection mode is turned on.</p></div><div class="refsect2" title="gtk.EntryCompletion.set_popup_completion"><a name="method-gtkentrycompletion--set-popup-completion"></a><h3>gtk.EntryCompletion.set_popup_completion</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_popup_completion</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>popup_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>popup_completion</code></strong> :</span></p></td><td>If <code class="literal">True</code> do popup
completion.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <code class="methodname">set_popup_completion</code>() method sets
the "popup-completion" property to the value of
<em class="parameter"><code>popup_completion</code></em>. If
<em class="parameter"><code>popup_completion</code></em> is <code class="literal">True</code> the
completions should be presented in a popup window.</p></div><div class="refsect2" title="gtk.EntryCompletion.get_popup_completion"><a name="method-gtkentrycompletion--get-popup-completion"></a><h3>gtk.EntryCompletion.get_popup_completion</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_popup_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><code class="literal">True</code> if completions should
be displayed in a popup.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <code class="methodname">get_popup_completion</code>() method
returns the value of the "popup-completion" property. If the value of
"popup-completion" property is <code class="literal">True</code> the completions
should be presented in a popup window.</p></div><div class="refsect2" title="gtk.EntryCompletion.set_popup_set_width"><a name="method-gtkentrycompletion--set-popup-set-width"></a><h3>gtk.EntryCompletion.set_popup_set_width</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_popup_set_width</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>popup_set_width</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>popup_set_width</code></strong> :</span></p></td><td>If <code class="literal">True</code> the completions
popup window will be resized to the width of the
completion.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">set_popup_set_width</code>() method sets
the "popup-set-width" property to the value of
<em class="parameter"><code>popup_set_width</code></em>. If
<em class="parameter"><code>popup_set_width</code></em> is <code class="literal">True</code> the
completions popup window will be resized to the width of the completion.</p></div><div class="refsect2" title="gtk.EntryCompletion.get_popup_set_width"><a name="method-gtkentrycompletion--get-popup-set-width"></a><h3>gtk.EntryCompletion.get_popup_set_width</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_popup_set_width</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 completions popup
window will be resized to the width of the completion.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">get_popup_set_width</code>() method
returns the value of the "popup-set-width" property. If the value of
"popup-set-width" property is <code class="literal">True</code> the completions popup
window will be resized to the width of the completion.</p></div><div class="refsect2" title="gtk.EntryCompletion.set_popup_single_match"><a name="method-gtkentrycompletion--set-popup-single-match"></a><h3>gtk.EntryCompletion.set_popup_single_match</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_popup_single_match</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>popup_single_match</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>popup_single_match</code></strong> :</span></p></td><td>If <code class="literal">True</code> the completions popup
window will appear even for a single match.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">set_popup_single_match</code>() method
sets the "popup-single-match" property to the value of
<em class="parameter"><code>popup_single_match</code></em>. If
<em class="parameter"><code>popup_single_match</code></em> is <code class="literal">True</code> the
completions popup window will appear even for a single match.</p></div><div class="refsect2" title="gtk.EntryCompletion.get_popup_completion"><a name="method-gtkentrycompletion--get-popup-single-match"></a><h3>gtk.EntryCompletion.get_popup_completion</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_popup_single_match</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 completions popup
window should appear even for a single match.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">get_popup_single_match</code>() method
returns the value of the "popup-single-match" property. If the value of
"popup-single-match" property is <code class="literal">True</code> the completions
popup window should appear even for a single match.</p></div><div class="refsect2" title="gtk.EntryCompletion.get_completion_prefix"><a name="method-gtkentrycompletion--get-completion-prefix"></a><h3>gtk.EntryCompletion.get_completion_prefix </h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_completion_prefix</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 prefix for the current completion.</td></tr></tbody></table><div class="note" title="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_completion_prefix</code>() method
gets the original text entered by the user that triggered the completion or
<code class="literal">None</code> if there's no completion ongoing.</p></div></div><div class="refsect1" title="Signals"><a name="id3693786"></a><h2>Signals</h2><div class="refsect2" title='The "action-activated" gtk.EntryCompletion Signal'><a name="signal-gtkentrycompletion--action-activated"></a><h3>The "action-activated" gtk.EntryCompletion Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>completion</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>index</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>completion</code></em> :</span></p></td><td>the entry completion that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>index</code></em> :</span></p></td><td>the index of the action item that was
activated.</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><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.4 and above.</p></div><p>The "action-activated" signal is emitted when an action item is
selected from the popup action list.</p></div><div class="refsect2" title='The "cursor-on-match" gtk.EntryCompletion Signal'><a name="signal-gtkentrycompletion--cursor-on-match"></a><h3>The "cursor-on-match" gtk.EntryCompletion Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>completion</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>model</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>iter</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>completion</code></em> :</span></p></td><td>the entry completion that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>model</code></em> :</span></p></td><td>The <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
containing the matches.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td><td>A <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
positioned at the selected match.</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><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.12 and above.</p></div><p>The "cursor-on-match" signal gets emitted when a match from the cursor
is on a match of the list.The default behaviour is to replace the contents
of the entry with the contents of the text column in the row pointed to by iter.</p></div><div class="refsect2" title='The "insert-prefix" gtk.EntryCompletion Signal'><a name="signal-gtkentrycompletion--insert-prefix"></a><h3>The "insert-prefix" gtk.EntryCompletion Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>completion</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>prefix</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>completion</code></em> :</span></p></td><td>the entry completion that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>prefix</code></em> :</span></p></td><td> the common prefix of all possible
completions</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><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.6 and above.</p></div><p>The "insert-prefix" signal is emitted when the inline
auto-completion is triggered. The default behavior is to make the entry
display the whole prefix and select the newly inserted part.</p><p>Applications may connect to this signal in order to insert only
a smaller part of the prefix into the entry - e.g. the entry used in the
<a class="link" href="class-gtkfilechooser.html" title="gtk.FileChooser"><code class="classname">gtk.FileChooser</code></a>
inserts only the part of the prefix up to the next '/'.</p></div><div class="refsect2" title='The "match-selected" gtk.EntryCompletion Signal'><a name="signal-gtkentrycompletion--match-selected"></a><h3>The "match-selected" gtk.EntryCompletion Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>completion</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>model</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>iter</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>completion</code></em> :</span></p></td><td>the entry completion that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>model</code></em> :</span></p></td><td>the <a class="link" href="class-gtktreemodel.html" title="gtk.TreeModel"><code class="classname">gtk.TreeModel</code></a>
that <em class="parameter"><code>iter</code></em> points into.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td><td>a <a class="link" href="class-gtktreeiter.html" title="gtk.TreeIter"><code class="classname">gtk.TreeIter</code></a>
pointing at the selection completion string row in
<em class="parameter"><code>model</code></em>.</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><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.4 and above.</p></div><p>The "match-selected" signal is emitted when a completion string
was selected from the completion list. <em class="parameter"><code>iter</code></em> points at
the row in <em class="parameter"><code>model</code></em> that contains the completion
string.</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-gtkentrybuffer.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-gtkeventbox.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.EntryBuffer </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.EventBox</td></tr></table></div></body></html>
|