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 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324
|
<?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>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkentrycompletion--get-text-column">get_text_column</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<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-inline-completion">set_inline_selection</link></methodname>
<methodparam><parameter
role="keyword">inline_selection</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkentrycompletion--get-inline-completion">get_inline_selection</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>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkentrycompletion--set-popup-set-width">set_popup_set_width</link></methodname>
<methodparam><parameter
role="keyword">popup_set_width</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkentrycompletion--get-popup-set-width">get_popup_set_width</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkentrycompletion--set-popup-single-match">set_popup_single_match</link></methodname>
<methodparam><parameter
role="keyword">popup_single_match</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkentrycompletion--get-popup-single-match">get_popup_single_match</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkentrycompletion--get-completion-prefix">get_completion_prefix</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>
</synopsis>
</refsect1>
<refsect1>
<title>Implemented Interfaces</title>
<para>
<link linkend="class-gtkentrycompletion"><classname>gtk.EntryCompletion</classname></link>
implements
<link linkend="class-gtkbuildable"><classname>gtk.Buildable</classname></link>
<link linkend="class-gtkcelllayout"><classname>gtk.CellLayout</classname></link>
</para>
</refsect1>
<refsect1 id="properties-gtkentrycompletion">
<title>gtk.EntryCompletion 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>"inline-selection"</entry>
<entry>Read-Write</entry>
<entry>Determines whether the possible completions on the popup will appear
in the entry as you navigate through them.
Default value: <literal>False</literal>. Available in GTK+ 2.12 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. Allowed values >= 0. Default value: 1</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>"popup-set-width"</entry>
<entry>Read-Write</entry>
<entry>If <literal>True</literal> the completions popup window
will be resized to the width of the entry. Default value:
<literal>True</literal>. Available in GTK+ 2.8 and
above.</entry>
</row>
<row valign="top">
<entry>"popup-single-match"</entry>
<entry>Read-Write</entry>
<entry>If <literal>True</literal> the completions popup window
will be for a single possible completion. Default value:
<literal>True</literal>. Available in GTK+ 2.8 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 id="signal-prototypes-gtkentrycompletion">
<title>gtk.EntryCompletion Signal Prototypes</title>
<para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>
<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--cursor-on-match">cursor-on-match</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>
<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>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
<literal>True</literal> from the signal handler to suppress the default behaviour.</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> :</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> :</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> :</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> :</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> :</term>
<listitem><simpara>A function to be used.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>func_data</parameter> :</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> :</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> :</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> :</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> :</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> :</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> :</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> :</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> :</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>
<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> :</term>
<listitem><simpara>The column containing the text
strings.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.8 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>
<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> :</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> :</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-inline-selection">
<title>gtk.EntryCompletion.set_inline_selection</title>
<programlisting><methodsynopsis language="python">
<methodname>set_inline_selection</methodname>
<methodparam><parameter role="keyword">inline_selection</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">inline_selection</parameter> :</term>
<listitem><simpara>if <literal>True</literal> do inline
selection</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.12 and above.</para>
</note>
<para>The <methodname>set_inline_selection</methodname>() method Sets whether
it is possible to cycle through the possible completions inside the entry.</para>
</refsect2>
<refsect2 id="method-gtkentrycompletion--get-inline-selection">
<title>gtk.EntryCompletion.get_inline_selection</title>
<programlisting><methodsynopsis language="python">
<methodname>get_inline_selection</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if automatic inline
selection is enabled.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.12 and above.</para>
</note>
<para>The <methodname>get_inline_selection</methodname>() method returns
<literal>True</literal> if inline-selection mode is turned on.</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> :</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> :</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>
<refsect2 id="method-gtkentrycompletion--set-popup-set-width">
<title>gtk.EntryCompletion.set_popup_set_width</title>
<programlisting><methodsynopsis language="python">
<methodname>set_popup_set_width</methodname>
<methodparam><parameter role="keyword">popup_set_width</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">popup_set_width</parameter> :</term>
<listitem><simpara>If <literal>True</literal> the completions
popup window will be resized to the width of the
completion.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.8 and above.</para>
</note>
<para>The <methodname>set_popup_set_width</methodname>() method sets
the "popup-set-width" property to the value of
<parameter>popup_set_width</parameter>. If
<parameter>popup_set_width</parameter> is <literal>True</literal> the
completions popup window will be resized to the width of the completion.</para>
</refsect2>
<refsect2 id="method-gtkentrycompletion--get-popup-set-width">
<title>gtk.EntryCompletion.get_popup_set_width</title>
<programlisting><methodsynopsis language="python">
<methodname>get_popup_set_width</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if the completions popup
window will be resized to the width of the completion.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.8 and above.</para>
</note>
<para>The <methodname>get_popup_set_width</methodname>() method
returns the value of the "popup-set-width" property. If the value of
"popup-set-width" property is <literal>True</literal> the completions popup
window will be resized to the width of the completion.</para>
</refsect2>
<refsect2 id="method-gtkentrycompletion--set-popup-single-match">
<title>gtk.EntryCompletion.set_popup_single_match</title>
<programlisting><methodsynopsis language="python">
<methodname>set_popup_single_match</methodname>
<methodparam><parameter role="keyword">popup_single_match</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">popup_single_match</parameter> :</term>
<listitem><simpara>If <literal>True</literal> the completions popup
window will appear even for a single match.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.8 and above.</para>
</note>
<para>The <methodname>set_popup_single_match</methodname>() method
sets the "popup-single-match" property to the value of
<parameter>popup_single_match</parameter>. If
<parameter>popup_single_match</parameter> is <literal>True</literal> the
completions popup window will appear even for a single match.</para>
</refsect2>
<refsect2 id="method-gtkentrycompletion--get-popup-single-match">
<title>gtk.EntryCompletion.get_popup_completion</title>
<programlisting><methodsynopsis language="python">
<methodname>get_popup_single_match</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if the completions popup
window should appear even for a single match.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.8 and above.</para>
</note>
<para>The <methodname>get_popup_single_match</methodname>() method
returns the value of the "popup-single-match" property. If the value of
"popup-single-match" property is <literal>True</literal> the completions
popup window should appear even for a single match.</para>
</refsect2>
<refsect2 id="method-gtkentrycompletion--get-completion-prefix ">
<title>gtk.EntryCompletion.get_completion_prefix </title>
<programlisting><methodsynopsis language="python">
<methodname>get_completion_prefix</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>The prefix for the current completion.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.12 and above.</para>
</note>
<para>The <methodname>get_completion_prefix</methodname>() method
gets the original text entered by the user that triggered the completion or
<literal>None</literal> if there's no completion ongoing.</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> :</term>
<listitem><simpara>the entry completion that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>index</parameter> :</term>
<listitem><simpara>the index of the action item that was
activated.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</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> :</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--cursor-on-match">
<title>The "cursor-on-match" 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> :</term>
<listitem><simpara>the entry completion that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>model</parameter> :</term>
<listitem><simpara>The <link linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>
containing the matches.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>iter</parameter> :</term>
<listitem><simpara>A <link linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link>
positioned at the selected match.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</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> :</term>
<listitem><simpara>additional user parameters (if
any)</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This signal is available in GTK+ 2.12 and above.</para>
</note>
<para>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.</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> :</term>
<listitem><simpara>the entry completion that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>prefix</parameter> :</term>
<listitem><simpara> the common prefix of all possible
completions</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</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> :</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> :</term>
<listitem><simpara>the entry completion that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>model</parameter> :</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> :</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> :</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> :</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>
|