Top |
gboolean | inline-completion | Read / Write |
gboolean | inline-selection | Read / Write |
int | minimum-key-length | Read / Write |
GtkTreeModel * | model | Read / Write |
gboolean | popup-completion | Read / Write |
gboolean | popup-set-width | Read / Write |
gboolean | popup-single-match | Read / Write |
int | text-column | Read / Write |
void | action-activated | Run Last |
gboolean | cursor-on-match | Run Last |
gboolean | insert-prefix | Run Last |
gboolean | match-selected | Run Last |
gboolean (*GtkEntryCompletionMatchFunc) (GtkEntryCompletion *completion
,const gchar *key
,GtkTreeIter *iter
,gpointer user_data
);
GtkEntryCompletion *
gtk_entry_completion_new (void
);
Creates a new GtkEntryCompletion object.
Since: 2.4
GtkWidget *
gtk_entry_completion_get_entry (GtkEntryCompletion *completion
);
Gets the entry completion
has been attached to.
Since: 2.4
void gtk_entry_completion_set_model (GtkEntryCompletion *completion
,GtkTreeModel *model
);
Sets the model for a GtkEntryCompletion. If completion
already has
a model set, it will remove it before setting the new model.
If model is NULL
, then it will unset the model.
Since: 2.4
GtkTreeModel *
gtk_entry_completion_get_model (GtkEntryCompletion *completion
);
Returns the model the GtkEntryCompletion is using as data source.
Returns NULL
if the model is unset.
Since: 2.4
void gtk_entry_completion_set_match_func (GtkEntryCompletion *completion
,GtkEntryCompletionMatchFunc func
,gpointer func_data
,GDestroyNotify func_notify
);
Sets the match function for completion
to be func
. The match function
is used to determine if a row should or should not be in the completion
list.
completion |
||
func |
The GtkEntryCompletionMatchFunc to use. |
|
func_data |
The user data for |
|
func_notify |
Destroy notifier for |
Since: 2.4
void gtk_entry_completion_set_minimum_key_length (GtkEntryCompletion *completion
,gint length
);
Requires the length of the search key for completion
to be at least
length
. 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
(ie, a too large dataset).
Since: 2.4
gint
gtk_entry_completion_get_minimum_key_length
(GtkEntryCompletion *completion
);
Returns the minimum key length as set for completion
.
Since: 2.4
void
gtk_entry_completion_complete (GtkEntryCompletion *completion
);
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.
Since: 2.4
const gchar *
gtk_entry_completion_get_completion_prefix
(GtkEntryCompletion *completion
);
Get the original text entered by the user that triggered
the completion or NULL
if there's no completion ongoing.
Since: 2.12
void
gtk_entry_completion_insert_prefix (GtkEntryCompletion *completion
);
Requests a prefix insertion.
Since: 2.6
void gtk_entry_completion_insert_action_text (GtkEntryCompletion *completion
,gint index_
,const gchar *text
);
Inserts an action in completion
's action item list at position index_
with text text
. If you want the action item to have markup, use
gtk_entry_completion_insert_action_markup()
.
Since: 2.4
void gtk_entry_completion_insert_action_markup (GtkEntryCompletion *completion
,gint index_
,const gchar *markup
);
Inserts an action in completion
's action item list at position index_
with markup markup
.
Since: 2.4
void gtk_entry_completion_delete_action (GtkEntryCompletion *completion
,gint index_
);
Deletes the action at index_
from completion
's action list.
Since: 2.4
void gtk_entry_completion_set_text_column (GtkEntryCompletion *completion
,gint column
);
Convenience function for setting up the most used case of this code: a
completion list with just strings. This function will set up completion
to have a list displaying all (and just) strings in the completion list,
and to get those strings from column
in the model of completion
.
This functions creates and adds a GtkCellRendererText for the selected
column. If you need to set the text column, but don't want the cell
renderer, use g_object_set()
to set the ::text_column property directly.
Since: 2.4
gint
gtk_entry_completion_get_text_column (GtkEntryCompletion *completion
);
Returns the column in the model of completion
to get strings from.
Since: 2.6
void gtk_entry_completion_set_inline_completion (GtkEntryCompletion *completion
,gboolean inline_completion
);
Sets whether the common prefix of the possible completions should be automatically inserted in the entry.
Since: 2.6
gboolean
gtk_entry_completion_get_inline_completion
(GtkEntryCompletion *completion
);
Returns whether the common prefix of the possible completions should be automatically inserted in the entry.
Since: 2.6
void gtk_entry_completion_set_inline_selection (GtkEntryCompletion *completion
,gboolean inline_selection
);
Sets whether it is possible to cycle through the possible completions inside the entry.
Since: 2.12
gboolean
gtk_entry_completion_get_inline_selection
(GtkEntryCompletion *completion
);
Returns TRUE
if inline-selection mode is turned on.
Since: 2.12
void gtk_entry_completion_set_popup_completion (GtkEntryCompletion *completion
,gboolean popup_completion
);
Sets whether the completions should be presented in a popup window.
Since: 2.6
gboolean
gtk_entry_completion_get_popup_completion
(GtkEntryCompletion *completion
);
Returns whether the completions should be presented in a popup window.
Since: 2.6
void gtk_entry_completion_set_popup_set_width (GtkEntryCompletion *completion
,gboolean popup_set_width
);
Sets whether the completion popup window will be resized to be the same width as the entry.
Since: 2.8
gboolean
gtk_entry_completion_get_popup_set_width
(GtkEntryCompletion *completion
);
Returns whether the completion popup window will be resized to the width of the entry.
Since: 2.8
void gtk_entry_completion_set_popup_single_match (GtkEntryCompletion *completion
,gboolean popup_single_match
);
Sets whether the completion popup window will appear even if there is
only a single match. You may want to set this to FALSE
if you
are using inline
completion.
Since: 2.8
gboolean
gtk_entry_completion_get_popup_single_match
(GtkEntryCompletion *completion
);
Returns whether the completion popup window will appear even if there is only a single match.
Since: 2.8
“inline-completion”
property “inline-completion” gboolean
Determines whether the common prefix of the possible completions should be inserted automatically in the entry. Note that this requires text-column to be set, even if you are using a custom match function.
Owner: GtkEntryCompletion
Flags: Read / Write
Default value: FALSE
Since: 2.6
“inline-selection”
property “inline-selection” gboolean
Determines whether the possible completions on the popup will appear in the entry as you navigate through them.
Owner: GtkEntryCompletion
Flags: Read / Write
Default value: FALSE
Since: 2.12
“minimum-key-length”
property “minimum-key-length” int
Minimum length of the search key in order to look up matches.
Owner: GtkEntryCompletion
Flags: Read / Write
Allowed values: >= 0
Default value: 1
“model”
property“model” GtkTreeModel *
The model to find matches in.
Owner: GtkEntryCompletion
Flags: Read / Write
“popup-completion”
property “popup-completion” gboolean
Determines whether the possible completions should be shown in a popup window.
Owner: GtkEntryCompletion
Flags: Read / Write
Default value: TRUE
Since: 2.6
“popup-set-width”
property “popup-set-width” gboolean
Determines whether the completions popup window will be resized to the width of the entry.
Owner: GtkEntryCompletion
Flags: Read / Write
Default value: TRUE
Since: 2.8
“popup-single-match”
property “popup-single-match” gboolean
Determines whether the completions popup window will shown
for a single possible completion. You probably want to set
this to FALSE
if you are using
Owner: GtkEntryCompletion
Flags: Read / Write
Default value: TRUE
Since: 2.8
“text-column”
property “text-column” int
The column of the model containing the strings. Note that the strings must be UTF-8.
Owner: GtkEntryCompletion
Flags: Read / Write
Allowed values: >= -1
Default value: -1
Since: 2.6
“action-activated”
signalvoid user_function (GtkEntryCompletion *widget, int index, gpointer user_data)
Gets emitted when an action is activated.
widget |
the object which received the signal |
|
index |
the index of the activated action |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.4
“cursor-on-match”
signalgboolean user_function (GtkEntryCompletion *widget, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
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
.
widget |
the object which received the signal |
|
model |
the GtkTreeModel containing the matches |
|
iter |
a GtkTreeIter positioned at the selected match |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.12
“insert-prefix”
signalgboolean user_function (GtkEntryCompletion *widget, char *prefix, gpointer user_data)
Gets emitted when the inline autocompletion is triggered. The default behaviour is to make the entry display the whole prefix and select the newly inserted part.
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 GtkFileChooser inserts only the part of the prefix up to the
next '/'.
widget |
the object which received the signal |
|
prefix |
the common prefix of all possible completions |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.6
“match-selected”
signalgboolean user_function (GtkEntryCompletion *widget, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
Gets emitted when a match from the list is selected.
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
.
widget |
the object which received the signal |
|
model |
the GtkTreeModel containing the matches |
|
iter |
a GtkTreeIter positioned at the selected match |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 2.4