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
  
/* -*- C -*- */ 
require gtk24; 
 
class GTK2.EntryCompletion; 
inherit G.Object; 
inherit GTK2.CellLayout; 
 
//! Properties: 
require gtk26; 
//! int inline-completion 
endrequire; 
//! int minimum-key-length 
//! GTK2.TreeModel model 
require gtk26; 
//! int popup-completion 
require gtk28; 
//! int popup-single-match 
endrequire; 
//! int text-column 
endrequire; 
 
signal action_activated; 
require gtk26; 
signal insert_prefix; 
endrequire; 
signal match_selected; 
 
void create(?mapping(string:mixed) props) 
//! Creates a new widget. 
{ 
  pgtk2_verify_not_inited(); 
  pgtk2_verify_setup(); 
  if (args) { 
    INIT_WITH_PROPS(GTK_TYPE_ENTRY_COMPLETION); 
    pgtk2_pop_n_elems(args); 
  } else { 
    GtkEntryCompletion *ge; 
    ge=gtk_entry_completion_new(); 
    THIS->obj=G_OBJECT(ge); 
  } 
  pgtk2__init_this_object(); 
} 
 
+GTK2.Widget get_entry(); 
//! Gets the entry this widget has been attached to. 
 
void set_match_func( function(object,string,object:void) cb ) 
//! Sets the function to be called to decide if a specific row should 
//! be displayed. 
{ 
  pgtk2_verify_inited(); 
  { 
      extern gboolean pgtk2_entry_completion_match_func( GtkEntryCompletion *x, 
                                                         const gchar *key, 
                                                         GtkTreeIter *iter, 
                                                         gpointer user_data); 
    struct signal_data *sd; 
    struct svalue *sv1; 
    get_all_args(NULL,args,"%*",&sv1); 
    sd=(struct signal_data *)g_malloc(sizeof(struct signal_data)); 
    if (sd==NULL) 
        SIMPLE_OUT_OF_MEMORY_ERROR("set_match_func",sizeof(struct signal_data)); 
    assign_svalue_no_free( &sd->cb, sv1 ); 
    SET_SVAL(sd->args, PIKE_T_INT, NUMBER_NUMBER, integer, 0); 
    gtk_entry_completion_set_match_func( GTK_ENTRY_COMPLETION(THIS->obj), 
                                         pgtk2_entry_completion_match_func, 
                                         (gpointer*)sd, 
                                         (GtkDestroyNotify)pgtk2_free_signal_data); 
  } 
  RETURN_THIS(); 
} 
 
void set_model(?GTK2.TreeModel model) 
//! Sets the model.  If this completion already has a model set, it will 
//! remove it before setting the new model.  If omitted it will unset the 
//! model. 
{ 
  pgtk2_verify_inited(); 
  if (args) { 
    struct object *o1; 
    get_all_args(NULL,args,"%o",&o1); 
    gtk_entry_completion_set_model(GTK_ENTRY_COMPLETION(THIS->obj), 
                GTK_TREE_MODEL(get_gobject(o1))); 
  } else { 
    gtk_entry_completion_set_model(GTK_ENTRY_COMPLETION(THIS->obj),NULL); 
  } 
  RETURN_THIS(); 
} 
 
+GTK2.TreeModel get_model(); 
//! Returns the model being used as the data source. 
 
void set_minimum_key_length(int length); 
//! Requires the length of the search key to be at least length long.  This is 
//! useful for long lists, where completing using a small key takes a lot of 
//! time and will come up with meaningless results anyway (i.e. a too large 
//! dataset). 
 
int get_minimum_key_length(); 
//! Returns the minimum key length. 
 
void complete(); 
//! Requests a completion operation, or in other words a refiltering of the 
//! current list with completions, using the current key.  The completion list 
//! view will be updated accordingly. 
 
require gtk26; 
void insert_prefix(); 
//! Requests a prefix insertion. 
endrequire; 
 
void insert_action_text(int index, string text); 
//! Inserts an action in the action item list at position index with the 
//! specified text.  If you want the action item to have markup, use 
//! insert_action_markup(). 
 
void insert_action_markup(int index, string markup); 
//! Inserts an action in the action item list at position index with the 
//! specified markup. 
 
void delete_action(int index); 
//! Deletes the action at index. 
 
void set_text_column(int column); 
//! Convenience function for setting up the most used case of this code: a 
//! completion list with just strings.  This function will set up the 
//! completion to have a list displaying all (and just) strings in the list, 
//! and to get those strings from column column in the model. 
 
require gtk26; 
int get_text_column(); 
//! Returns the column in the model to get strings from. 
 
void set_inline_completion(int inline_completion); 
//! Sets whether the common prefix of the possible completions should be 
//! automatically inserted in the entry. 
 
int get_inline_completion(); 
//! Returns whether the common prefix of the possible completions should be 
//! automatically inserted in the entry. 
 
void set_popup_completion(int setting); 
//! Sets whether the completions should be presented in a popup window. 
 
int get_popup_completion(); 
//! Returns whether completions should be presented in a popup window. 
endrequire; 
 
require gtk212; 
void set_inline_selection(int inline_selection); 
//! Sets whether it is possible to cycle through the possible completions inside the entry. 
endrequire; 
 
require gtk28; 
void set_popup_set_width(int setting); 
//! Sets whether the completion popup window will be resized to be the same 
//! width as the entry. 
 
int get_popup_set_width(); 
//! Returns whether the completion popup window will be resized to the width 
//! of the entry. 
 
void set_popup_single_match(int setting); 
//! Sets whether the completion popup window will appear even if there is only 
//! a single match.  You may want to set this to 0 if you are using inline 
//! completion. 
 
int get_popup_single_match(); 
//! Returns whether the completion popup window will appear even if there is 
//! only a single match. 
endrequire; 
 
endrequire;