Next: , Previous: clipboard, Up: Gtk+ Objects

6.4.17 entry-completion

— Class: entry-completion

Superclass: g-object buildable cell-layout

entry-completion is an auxiliary object to be used in conjunction with entry to provide the completion functionality. It implements the cell-layout interface, to allow the user to add extra cells to the tree-view with completion matches.

"Completion functionality" means that when the user modifies the text in the entry, 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 entry-completion-text-column), but this can be overridden with a custom match function (see entry-completion-match-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 entry-completion::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 gtk_entry_set_completion().

In addition to regular completion matches, which will be inserted into the entry when they are selected, GtkEntryCompletion 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 entry-completion::action-activated signal is emitted.



— Method: entry-completion-complete
     (entry-completion-complete 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.

— Method: entry-completion-completion-prefix
     (entry-completion-completion-prefix completion) => string

Get the original text entered by the user that triggered the completion or NULL if there's no completion ongoing.

— Method: entry-completion-insert-prefix
     (entry-completion-insert-prefix completion)

Requests a prefix insertion.

— Method: entry-completion-insert-action-text
     (entry-completion-insert-action-text completion index 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 entry-completion-insert-action-markup.

— Method: entry-completion-insert-action-markup
     (entry-completion-insert-action-markup completion index markup)

Inserts an action in completion's action item list at position index with markup markup.

— Method: entry-completion-delete-action
     (entry-completion-delete-action completion index)

Deletes the action at index from completion's action list.