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 text entry, the gtk:entry-completion object checks which rows in the model match the current content of the text entry, and displays a list of matches. By default, the matching is done by comparing the 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 text entry is updated. By default, the content of the text 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 text 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 a text entry, use the gtk:entry-completion function. 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 gtk:entry-completion widget "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 a gtk:cell-layout-data-func function or the "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. WarningSignal DetailsThe "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 |
2024-5-2