Completion functionality for GtkEntry
<gtk-entry-completion> is an auxiliary object to be used in conjunction
<gtk-entry> to provide the completion functionality. It implements
<gtk-cell-layout> interface, to allow the user to add extra cells to
<gtk-tree-view> with completion matches.
"Completion functionality" means that when the user modifies the text in the
<gtk-entry-completion> checks which rows in the model match the
current content of the entry, and displays a list of matches. By default, the
matching is done by comparing the entry text case-insensitively against the text
column of the model (see
gtk-entry-completion-set-text-column), but this
can be overridden with a custom match function (see
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
#t’ from the signal handler to suppress the default behaviour.
To add completion functionality to an entry, use
In addition to regular completion matches, which will be inserted into the entry
when they are selected,
<gtk-entry-completion> also allows to display
"actions" in the popup window. Their appearance is similar to menuitems, to
differentiate them clearly from completion strings. When an action is selected,
the ::action-activated signal is emitted.
This class defines the following slots:
- The model to find matches in
- Minimum length of the search key in order to look up matches
- The column of the model containing the strings.
- Whether the common prefix should be inserted automatically
- Whether the completions should be shown in a popup window
- If TRUE, the popup window will have the same size as the entry
- If TRUE, the popup window will appear for a single match.
- Your description here
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
<gtk-file-chooser>inserts only the part of the prefix up to the next '/'.
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.
Gets emitted when an action is activated.
Creates a new
- A newly created
<gtk-entry-completion>) ⇒ (ret
Gets the entry completion has been attached to.
- The entry completion has been attached to.
Sets the model for a
<gtk-entry-completion>. If completion already has a model set, it will remove it before setting the new model. If model is ‘
#f’, then it will unset the model.
<gtk-entry-completion>) ⇒ (ret
Returns the model the
<gtk-entry-completion>is using as data source. Returns ‘
#f’ if the model is unset.
<gtk-tree-model>, or ‘
#f’ if none is currently being used.
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.
Requests a prefix insertion.