EntryCompletion


Object Hierarchy:

Gtk.EntryCompletion Gtk.EntryCompletion Gtk.EntryCompletion GLib.Object GLib.Object GLib.Object->Gtk.EntryCompletion Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.EntryCompletion Gtk.CellLayout Gtk.CellLayout Gtk.CellLayout->Gtk.EntryCompletion

Description:

[ CCode ( type_id = "gtk_entry_completion_get_type ()" ) ]
public class EntryCompletion : Object, Buildable, CellLayout

`GtkEntryCompletion` is an auxiliary object to provide completion functionality for `GtkEntry`.

It implements the [[email protected]] interface, to allow the user to add extra cells to the `GtkTreeView` with completion matches.

“Completion functionality” means that when the user modifies the text in the entry, `GtkEntryCompletion` 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 [[email protected]_text_column]), but this can be overridden with a custom match function (see [[email protected]_match_func]).

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 [[email protected]:GtkEntryCompletion: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 [[email protected]_completion].

`GtkEntryCompletion` uses a [[email protected]] model to represent the subset of the entire model that is currently matching. While the `GtkEntryCompletion` signals [[email protected]:GtkEntryCompletion:match-selected] and [ [email protected]:GtkEntryCompletion:cursor-on-match] take the original model and an iter pointing to that model as arguments, other callbacks and signals (such as `GtkCellLayoutDataFunc` or [[email protected]:GtkEntryCompletion:apply-attributes s)] will generally take the filter model as argument. As long as you are only calling [[email protected]], this will make no difference to you. If for some reason, you need the original model, use [[email protected]_model]. Don’t forget to use [ [email protected]_iter_to_child_iter] to obtain a matching iter.


Namespace: Gtk
Package: gtk4

Content:

Properties:

Creation methods:

Methods:

Signals:

Inherited Members:

All known members inherited from class GLib.Object



2022 vala-language.org