summaryrefslogtreecommitdiff
path: root/docs/reference/pygtk-gtkentrycompletion.xml
blob: c5edb4996424341183f2ec0ae3cde0a6f4575d22 (plain)
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="class-gtkentrycompletion">
  <refnamediv>
    <refname>gtk.EntryCompletion</refname> <refpurpose>completion
    functionality for <link
    linkend="class-gtkentry"><classname>gtk.Entry</classname></link> (new in
    PyGTK 2.4)</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.EntryCompletion</classname></ooclass>
      <ooclass><classname><link
      linkend="class-gobject">gobject.GObject</link></classname></ooclass>
      <ooclass><classname><link
      linkend="class-gtkcelllayout">gtk.CellLayout</link></classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link
	linkend="constructor-gtkentrycompletion">gtk.EntryCompletion</link></methodname>
	<methodparam></methodparam> </constructorsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkentrycompletion--get-entry">get_entry</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkentrycompletion--set-model">set_model</link></methodname>
	<methodparam><parameter role="keyword">model</parameter><initializer>None</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkentrycompletion--get-model">get_model</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkentrycompletion--set-match-func">set_match_func</link></methodname>
	<methodparam><parameter>func</parameter></methodparam>
	<methodparam><parameter>func_data</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkentrycompletion--set-minimum-key-length">set_minimum_key_length</link></methodname>
	<methodparam><parameter role="keyword">length</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkentrycompletion--get-minimum-key-length">get_minimum_key_length</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkentrycompletion--complete">complete</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkentrycompletion--insert-action-text">insert_action_text</link></methodname>
	<methodparam><parameter role="keyword">index</parameter></methodparam>
	<methodparam><parameter role="keyword">text</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkentrycompletion--insert-action-markup">insert_action_markup</link></methodname>
	<methodparam><parameter role="keyword">index</parameter></methodparam>
	<methodparam><parameter role="keyword">markup</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkentrycompletion--delete-action">delete_action</link></methodname>
	<methodparam><parameter role="keyword">index</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkentrycompletion--insert-prefix">insert_prefix</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
	linkend="method-gtkentrycompletion--set-text-column">set_text_column</link></methodname>
	<methodparam><parameter
	role="keyword">column</parameter></methodparam>
      </methodsynopsis>

<!-- NOT IMPLEMENTED
      <methodsynopsis language="python">
	<methodname><link
	linkend="method-gtkentrycompletion- -get-text-column">get_text_column</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
END NOT IMPLEMENTED -->

      <methodsynopsis language="python">
	<methodname><link
	linkend="method-gtkentrycompletion--set-inline-completion">set_inline_completion</link></methodname>
	<methodparam><parameter
	role="keyword">inline_completion</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
	linkend="method-gtkentrycompletion--get-inline-completion">get_inline_completion</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
	linkend="method-gtkentrycompletion--set-popup-completion">set_popup_completion</link></methodname>
	<methodparam><parameter
	role="keyword">popup_completion</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
	linkend="method-gtkentrycompletion--get-popup-completion">get_popup_completion</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gtkentrycompletion">gtk.EntryCompletion</link> (implements <link linkend="class-gtkcelllayout">gtk.CellLayout</link>)
</synopsis>

  </refsect1>

  <refsect1>
    <title>Properties</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"inline-completion"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>TRUE</literal> the common prefix should be
inserted automatically. Default value: <literal>FALSE</literal>. Available
in GTK+ 2.6 and above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"minimum-key-length"</entry>
	      <entry>Read-Write</entry>
	      <entry>Minimum length of the search key in order to look up
	      matches.</entry>
	    </row>

	    <row valign="top">
	      <entry>"model"</entry>
	      <entry>Read-Write</entry>
	      <entry>The <link 
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link> to 
find matches in.</entry>
	    </row>

	    <row valign="top">
	      <entry>"popup-completion"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>TRUE</literal> the completions should be
shown in a popup window. Default value: <literal>TRUE</literal>. Available
in GTK+ 2.6 and above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"text-column"</entry>
	      <entry>Read-Write</entry>
	      <entry>The column of the model containing the strings. Allowed
values: >= -1. Default value: -1. Available in GTK+ 2.6 and above.</entry>
	    </row>

	  </tbody>
	</tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1>
    <title>Signal Prototypes</title>

    <variablelist>
      <varlistentry>
        <term>"<link linkend="signal-gtkentrycompletion--action-activated">action-activated</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>completion</parameter></methodparam>
            <methodparam><parameter>index</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkentrycompletion--insert-prefix">insert-prefix</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>completion</parameter></methodparam>
            <methodparam><parameter>prefix</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkentrycompletion--match-selected">match-selected</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>completion</parameter></methodparam>
            <methodparam><parameter>model</parameter></methodparam>
            <methodparam><parameter>iter</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
    </variablelist>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <note>
      <para>This widget is available in PyGTK 2.4 and above.</para>
    </note>

    <para><link
linkend="class-gtkentrycompletion"><classname>gtk.EntryCompletion</classname></link>
is an auxiliary object to be used in conjunction with <link
linkend="class-gtkentry"><classname>gtk.Entry</classname></link> to provide
completion functionality. It implements the <link
linkend="class-gtkcelllayout"><classname>gtk.CellLayout</classname></link>
interface, to allow the user to add extra cells to the popup display of
completions.</para>

    <para>To add completion functionality to an entry, use the <link
linkend="method-gtkentry--set-completion"><methodname>gtk.Entry.set_completion</methodname>()</link>
method.  In addition to regular completion matches, that will be inserted
into the entry when they are selected, <link
linkend="class-gtkentrycompletion"><classname>gtk.EntryCompletion</classname></link>
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.</para>

    <para>A <link
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>
(e.g. a <link
linkend="class-gtkliststore"><classname>gtk.ListStore</classname></link>)
containing the completion strings is associated with the <link
linkend="class-gtkentrycompletion"><classname>gtk.EntryCompletion</classname></link>
using the <link
linkend="method-gtkentrycompletion--set-model"><methodname>set_model</methodname>()</link>
method. The tree model column containing the completion strings can be set
using the convenience method <link
linkend="method-gtkentrycompletion--set-text-column"><methodname>set_text_column</methodname>()</link>
that also creates a <link
linkend="class-gtkcellrenderertext"><classname>gtk.CellRendererText</classname></link>
and packs it into the entry completion.</para>

    <para>Otherwise, you can create <link
linkend="class-gtkcellrenderer"><classname>gtk.CellRenderer</classname></link>
objects and pack them into the <link
linkend="class-gtkentrycompletion"><classname>gtk.EntryCompletion</classname></link>
using the <link
linkend="class-gtkcelllayout"><classname>gtk.CellLayout</classname></link>
methods <link
linkend="method-gtkcelllayout--pack-start"><methodname>gtk.CellLayout.pack_start</methodname>()</link>
or <link
linkend="method-gtkcelllayout--pack-start"><methodname>gtk.CellLayout.pack_start</methodname>()</link>. However,
you will also have to define a match function and set it with the <link
linkend="method-gtkentrycompletion--set-match-func"><methodname>set_match_func</methodname>()</link>
method.</para>

    <para>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:</para>

    <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])
</programlisting>

    <para>This will create an entry that will display a pixbuf and the text
string during completion.</para>

    <para>Actions are easily managed using the <link
    linkend="method-gtkentrycompletion--insert-action-text"><methodname>insert_action_text</methodname>()</link>,
    <link
    linkend="method-gtkentrycompletion--insert-action-markup"><methodname>insert_action_markup</methodname>()</link>
    and <link
    linkend="method-gtkentrycompletion--delete-action"><methodname>delete_action</methodname>()</link>
    methods.</para>

  </refsect1>

  <refsect1 id="constructor-gtkentrycompletion">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
	<methodname>gtk.EntryCompletion</methodname>
	<methodparam></methodparam>  </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>A newly created <link linkend="class-gtkentrycompletion"><classname>gtk.EntryCompletion</classname></link> object.</simpara></listitem>
      </varlistentry>
    </variablelist>

    <note>
      <para>This constructor is available in PyGTK 2.4 and above.</para>
    </note>

    <para>Creates a new <link
linkend="class-gtkentrycompletion"><classname>gtk.EntryCompletion</classname></link>
object.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

  <refsect2 id="method-gtkentrycompletion--get-entry">
    <title>gtk.EntryCompletion.get_entry</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_entry</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>The <link
	  linkend="class-gtkentry"><classname>gtk.Entry</classname></link>
	  that the completion is attached to.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_entry</methodname>() method retrieves the
<link linkend="class-gtkentry"><classname>gtk.Entry</classname></link> that
the entry completion is attached to.</para>

    </refsect2>

    <refsect2 id="method-gtkentrycompletion--set-model">
      <title>gtk.EntryCompletion.set_model</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_model</methodname>
	  <methodparam><parameter role="keyword">model</parameter><initializer>None</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">model</parameter>&nbsp;:</term>
	  <listitem><simpara>The <link
	  linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>
	  to use with the entry completion.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_model</methodname>() method sets the <link
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>
specified by <parameter>model</parameter> to be used with the entry
completion. A previously set model will be removed before the new model
is set. If <parameter>model</parameter> is <literal>None</literal> or not
specified, the old model will be unset.</para>

      <note>
        <para>In PyGTK 2.4.0 the model could not be <literal>None</literal>
and did not default to <literal>None</literal>.</para>
      </note>

    </refsect2>

    <refsect2 id="method-gtkentrycompletion--get-model">
      <title>gtk.EntryCompletion.get_model</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_model</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>The current <link
	  linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>,
	  or <literal>None</literal> if not set.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_model</methodname>() method returns the
<link
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>
that the entry completion is using as data source. Returns
<literal>None</literal> if the model is unset.</para>

    </refsect2>

    <refsect2 id="method-gtkentrycompletion--set-match-func">
      <title>gtk.EntryCompletion.set_match_func</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_match_func</methodname>
	  <methodparam><parameter>func</parameter></methodparam>
	  <methodparam><parameter>func_data</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>func</parameter>&nbsp;:</term>
	  <listitem><simpara>A function to be used.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>func_data</parameter>&nbsp;:</term>
	  <listitem><simpara>The user data for <parameter>func</parameter>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_match_func</methodname>() method sets the
match function specified by <parameter>func</parameter>. 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.</para>

      <para>The signature of the match function is:</para>

      <programlisting>
  def match_func(completion, key_string, iter, func_data):
</programlisting>

      <para>where <parameter>completion</parameter> is the <link
linkend="class-gtkentrycompletion"><classname>gtk.EntryCompletion</classname></link>
that the match function is invoked on, <parameter>key_string</parameter> is
the current contents of the <link
linkend="class-gtkentry"><classname>gtk.Entry</classname></link> to be
matched, <parameter>iter</parameter> is a <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link>
pointing at a row in the <link
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>
associated with completion and <parameter>func_data</parameter> is the data
specified when the <link
linkend="method-gtkentrycompletion--set-match-func"><methodname>set_match_func</methodname>()</link>
method was called. The match function should return <literal>TRUE</literal>
if the completion string should be displayed; otherwise,
<literal>FALSE</literal>.</para>

      <para>A simple example match function is:</para>

      <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
</programlisting>

      <para>You must use the <link
linkend="method-gtkentrycompletion--set-match-func"><methodname>set_match_func</methodname>()</link>
method to display completions if you don't use the <link
linkend="method-gtkentrycompletion--set-text-column"><methodname>set_text_column</methodname>()</link>
method.</para>

    </refsect2>

    <refsect2 id="method-gtkentrycompletion--set-minimum-key-length">
      <title>gtk.EntryCompletion.set_minimum_key_length</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_minimum_key_length</methodname>
	  <methodparam><parameter role="keyword">length</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">length</parameter>&nbsp;:</term>
	  <listitem><simpara>The minimum length of the key string in order
	  to start completing.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_minimum_key_length</methodname>() method
sets the minimum length of the search key to the value specified by
<parameter>length</parameter>. This means that the key string (contents of
the <link linkend="class-gtkentry"><classname>gtk.Entry</classname></link>)
must be at least <parameter>length</parameter> 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.</para>

    </refsect2>

    <refsect2 id="method-gtkentrycompletion--get-minimum-key-length">
      <title>gtk.EntryCompletion.get_minimum_key_length</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_minimum_key_length</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>The currently used minimum key
	  length.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_minimum_key_length</methodname>() method
returns the minimum key length set for the entry completion. See the
<link
linkend="method-gtkentrycompletion--set-minimum-key-length"><methodname>set_minimum_key_length</methodname>()</link>
method for more information.</para>

    </refsect2>

    <refsect2 id="method-gtkentrycompletion--complete">
      <title>gtk.EntryCompletion.complete</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>complete</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>complete</methodname>() 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.</para>

    </refsect2>

    <refsect2 id="method-gtkentrycompletion--insert-action-text">
      <title>gtk.EntryCompletion.insert_action_text</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>insert_action_text</methodname>
	  <methodparam><parameter role="keyword">index</parameter></methodparam>
	  <methodparam><parameter role="keyword">text</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">index</parameter>&nbsp;:</term>
	  <listitem><simpara>The index in the action list where the item
	  should be inserted.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">text</parameter>&nbsp;:</term>
	  <listitem><simpara>The text of the item to
	  insert.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>insert_action_text</methodname>() method inserts
an action in the action item list of the entry completion at the position
specified by <parameter>index</parameter> with the text specified by
<parameter>text</parameter>. If you want the action item to have markup, use
the <link
linkend="method-gtkentrycompletion--insert-action-markup"><methodname>gtk.EntryCompletion.insert_action_markup()</methodname></link>
method.</para>

    </refsect2>

    <refsect2 id="method-gtkentrycompletion--insert-action-markup">
      <title>gtk.EntryCompletion.insert_action_markup</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>insert_action_markup</methodname>
	  <methodparam><parameter role="keyword">index</parameter></methodparam>
	  <methodparam><parameter role="keyword">markup</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">index</parameter>&nbsp;:</term>
	  <listitem><simpara>The index in the action list where the item
	  should be inserted.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">markup</parameter>&nbsp;:</term>
	  <listitem><simpara>The Pango markup of the item to
	  insert.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>insert_action_markup</methodname>() method
inserts an action item in the action item list of the entry completion at
the position specified by <parameter>index</parameter> with the Pango markup
specified by <parameter>markup</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtkentrycompletion--delete-action">
      <title>gtk.EntryCompletion.delete_action</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>delete_action</methodname>
	  <methodparam><parameter role="keyword">index</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">index</parameter>&nbsp;:</term>
	  <listitem><simpara>The index of the item to
	  delete.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>delete_action</methodname>() method deletes the
action item at the position in the action item list specified by
<parameter>index</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtkentrycompletion--insert-prefix">
      <title>gtk.EntryCompletion.insert_prefix</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>insert_prefix</methodname>
	</methodsynopsis></programlisting>

      <note>
	<para>This method is available in PyGTK 2.6 and above.</para>
      </note>

      <para>The <methodname>insert_prefix</methodname>() method requests a
prefix insertion.</para>

    </refsect2>

    <refsect2 id="method-gtkentrycompletion--set-text-column">
      <title>gtk.EntryCompletion.set_text_column</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_text_column</methodname>
	  <methodparam><parameter role="keyword">column</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">column</parameter>&nbsp;:</term>
	  <listitem><simpara>The column in the model to get strings
	  from.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_text_column</methodname>() 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 <link
linkend="class-gtkcellrenderertext"><classname>gtk.CellRendererText</classname></link>
using the column specified by <parameter>column</parameter> as the source
for completion strings. If you don't use this method you will have to
install a <link
linkend="class-gtkcellrenderertext"><classname>gtk.CellRendererText</classname></link>
in the entry completion and set a match function using the <link
linkend="method-gtkentrycompletion--set-match-func"><methodname>set_match_func</methodname>()</link>
method to display the completion strings. In GTK+ 2.6 the "text-column"
property is set to the value of <parameter>column</parameter>.</para>

    </refsect2>

<!-- NOT IMPLEMENTED
    <refsect2 id="method-gtkentrycompletion- -get-text-column">
      <title>gtk.EntryCompletion.get_text_column</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_text_column</methodname>
	  <methodparam></methodparam>
        </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>The column containing the text
strings.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.6 and above.</para>
      </note>

      <para>The <methodname>get_text_column</methodname>() 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
<link
linkend="method-gtkentrycompletion- -set-text-column"><methodname>set_text_column</methodname>()</link>
method for more information.</para>

    </refsect2>
END NOT IMPLEMENTED -->

    <refsect2 id="method-gtkentrycompletion--set-inline-completion">
      <title>gtk.EntryCompletion.set_inline_completion</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_inline_completion</methodname>
	  <methodparam><parameter role="keyword">inline_completion</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">inline_completion</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>TRUE</literal> do inline
completion</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.6 and above.</para>
      </note>

      <para>The <methodname>set_inline_completion</methodname>() method sets
the "inline-completion" property to the value of
<parameter>inline_completion</parameter>. If
<parameter>inline_completion</parameter> is <literal>TRUE</literal>, the
common prefix of the possible completions should be automatically inserted
in the entry.</para>

    </refsect2>

    <refsect2 id="method-gtkentrycompletion--get-inline-completion">
      <title>gtk.EntryCompletion.get_inline_completion</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_inline_completion</methodname>
	  <methodparam></methodparam>
        </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>TRUE</literal> if automatic inline
completion is enabled.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.6 and above.</para>
      </note>

      <para>The <methodname>get_inline_completion</methodname>() method
returns the value of the "inline-completion" property. If the value of the
"inline-completion" property is <literal>TRUE</literal> the common prefix of
possible completions is automatically inserted in the entry.</para>

    </refsect2>

    <refsect2 id="method-gtkentrycompletion--set-popup-completion">
      <title>gtk.EntryCompletion.set_popup_completion</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_popup_completion</methodname>
	  <methodparam><parameter role="keyword">popup_completion</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">popup_completion</parameter>&nbsp;:</term>
	  <listitem><simpara>If <literal>TRUE</literal> do popup
completion.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.6 and above.</para>
      </note>

      <para>The <methodname>set_popup_completion</methodname>() method sets
the "popup-completion" property to the value of
<parameter>popup_completion</parameter>. If
<parameter>popup_completion</parameter> is <literal>TRUE</literal> the
completions should be presented in a popup window.</para>

    </refsect2>

    <refsect2 id="method-gtkentrycompletion--get-popup-completion">
      <title>gtk.EntryCompletion.get_popup_completion</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_popup_completion</methodname>
	  <methodparam></methodparam>
        </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>TRUE</literal> if completions should
be displayed in a popup.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.6 and above.</para>
      </note>

      <para>The <methodname>get_popup_completion</methodname>() method
returns the value of the "popup-completion" property. If the value of
"popup-completion" property is <literal>TRUE</literal> the completions
should be presented in a popup window.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Signals</title>

    <refsect2 id="signal-gtkentrycompletion--action-activated">
      <title>The "action-activated" gtk.EntryCompletion Signal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>callback</methodname>
	  <methodparam><parameter>completion</parameter></methodparam>
	  <methodparam><parameter>index</parameter></methodparam>
	  <methodparam><parameter>user_param1</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
	<varlistentry>
	  <term><parameter>completion</parameter>&nbsp;:</term>
	  <listitem><simpara>the entry completion that received the
signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>index</parameter>&nbsp;:</term>
	  <listitem><simpara>the index of the action item that was
	  activated.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>...</parameter>&nbsp;:</term>
	  <listitem><simpara>additional user parameters (if
any)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This signal is available in GTK+ 2.4 and above.</para>
      </note>

      <para>The "action-activated" signal is emitted when an action item is
selected from the popup action list.</para>

    </refsect2>

    <refsect2 id="signal-gtkentrycompletion--insert-prefix">
      <title>The "insert-prefix" gtk.EntryCompletion Signal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>callback</methodname>
	  <methodparam><parameter>completion</parameter></methodparam>
	  <methodparam><parameter>prefix</parameter></methodparam>
	  <methodparam><parameter>user_param1</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
	<varlistentry>
	  <term><parameter>completion</parameter>&nbsp;:</term>
	  <listitem><simpara>the entry completion that received the
signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>prefix</parameter>&nbsp;:</term>
	  <listitem><simpara> the common prefix of all possible
completions</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>...</parameter>&nbsp;:</term>
	  <listitem><simpara>additional user parameters (if
any)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This signal is available in GTK+ 2.6 and above.</para>
      </note>

      <para>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.</para>

      <para>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
<link
linkend="class-gtkfilechooser"><classname>gtk.FileChooser</classname></link>
inserts only the part of the prefix up to the next '/'.</para>

    </refsect2>

    <refsect2 id="signal-gtkentrycompletion--match-selected">
      <title>The "match-selected" gtk.EntryCompletion Signal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>callback</methodname>
	  <methodparam><parameter>completion</parameter></methodparam>
	  <methodparam><parameter>model</parameter></methodparam>
	  <methodparam><parameter>iter</parameter></methodparam>
	  <methodparam><parameter>user_param1</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
	<varlistentry>
	  <term><parameter>completion</parameter>&nbsp;:</term>
	  <listitem><simpara>the entry completion that received the
signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>model</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
	  linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>
	  that <parameter>iter</parameter> points into.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>iter</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
	  linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link>
	  pointing at the selection completion string row in
	  <parameter>model</parameter>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>...</parameter>&nbsp;:</term>
	  <listitem><simpara>additional user parameters (if
any)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This signal is available in GTK+ 2.4 and above.</para>
      </note>

      <para>The "match-selected" signal is emitted when a completion string
was selected from the completion list. <parameter>iter</parameter> points at
the row in <parameter>model</parameter> that contains the completion
string.</para>

    </refsect2>

  </refsect1>

</refentry>