Package: gtk
Class gtk:entry-completion
SuperclassesDocumented Subclasses
None
Direct SlotsDetails The gtk:entry-completion object is an auxiliary object to be used in conjunction with the gtk:entry widget to provide the completion
functionality. It implements the gtk:cell-layout interface, to allow the user to add extra cells to the gtk:tree-view widget with completion matches. "Completion functionality" means that when the user modifies the text in the entry, the gtk:entry-completion object 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 the gtk:entry-completion-text-column function, but this can be overridden with a custom match function, see the gtk:entry-completion-set-match-func function. 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 true from the signal handler to suppress the default behaviour. To add completion functionality to an entry, use the gtk:entry-completion function. In addition to regular completion matches, which will be inserted into the entry when they are selected, the gtk:entry-completion object also allows to display "actions" in the popup window. Their appearance is similar to menu items, to differentiate them clearly from completion strings. When an action is selected, the "action-activated" signal is emitted. The gtk:entry-completion object uses a gtk:tree-model-filter model to represent the subset of the entire model that is currently matching. While the "match-selected" and "cursor-on-match" signals take the original model and an iterator pointing to that model as arguments, other callbacks and signals, such as the gtk:cell-layout-data-func callback or "apply-attributes" signal, will generally take the filter model as argument. As long as you are only calling the gtk:tree-model-get function, this will make no difference to you. If for some reason, you need the original model, use the gtk:tree-model-filter-model function. Do not forget to use the gtk:tree-model-filter-convert-iter-to-child-iter function to obtain a matching iterator. Signal DetailsThe "action-activated" signallambda (widget index) :run-last
The "cursor-on-match" signallambda (widget model iter) :run-last
The "insert-prefix" signallambda (widget prefix) :run-last
The "match-selected" signallambda (widget model iter) :run-last
The "no-matches" signallambda (widget) :run-last
| Returned bySlot Access FunctionsInherited Slot Access FunctionsSee also |
2025-07-09