EntryCompletion

open class EntryCompletion(pointer: <Error class: unknown class><<Error class: unknown class>>) : Buildable, CellLayout

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

It implements the iface@Gtk.CellLayout 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 method@Gtk.EntryCompletion.set_text_column), but this can be overridden with a custom match function (see method@Gtk.EntryCompletion.set_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 signal@Gtk.EntryCompletion::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 method@Gtk.Entry.set_completion.

GtkEntryCompletion uses a class@Gtk.TreeModelFilter model to represent the subset of the entire model that is currently matching. While the GtkEntryCompletion signals signal@Gtk.EntryCompletion::match-selected and signal@Gtk.EntryCompletion::cursor-on-match take the original model and an iter pointing to that model as arguments, other callbacks and signals (such as GtkCellLayoutDataFunc or signal@Gtk.CellArea::apply-attributes) will generally take the filter model as argument. As long as you are only calling method@Gtk.TreeModel.get, this will make no difference to you. If for some reason, you need the original model, use method@Gtk.TreeModelFilter.get_model. Don’t forget to use method@Gtk.TreeModelFilter.convert_iter_to_child_iter to obtain a matching iter.

Skipped during bindings generation

  • method cell-area: Property has no getter nor setter

Constructors

Link copied to clipboard
constructor()

Creates a new GtkEntryCompletion object.

constructor(area: CellArea)

Creates a new GtkEntryCompletion object using the specified @area.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val gtkBuildablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gtkCellLayoutPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gtkEntryCompletionPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

Determines whether the common prefix of the possible completions should be inserted automatically in the entry.

Link copied to clipboard

Determines whether the possible completions on the popup will appear in the entry as you navigate through them.

Link copied to clipboard
open var minimumKeyLength: <Error class: unknown class>

The minimum key length as set for completion.

Link copied to clipboard
open var model: TreeModel?

The model used as data source.

Link copied to clipboard

Determines whether the possible completions should be shown in a popup window.

Link copied to clipboard

Determines whether the completions popup window will be resized to the width of the entry.

Link copied to clipboard

Determines whether the completions popup window will shown for a single possible completion.

Link copied to clipboard
open var textColumn: <Error class: unknown class>

The column of the model containing the strings.

Functions

Link copied to clipboard
open fun addAttribute(cell: CellRenderer, attribute: String, column: <Error class: unknown class>)

Adds an attribute mapping to the list in @cell_layout.

Link copied to clipboard
open fun clear()

Unsets all the mappings on all renderers on @cell_layout and removes all renderers from @cell_layout.

Link copied to clipboard

Clears all existing attributes previously set with gtk_cell_layout_set_attributes().

Link copied to clipboard
open fun complete()

Requests a completion operation, or in other words a refiltering of the current list with completions, using the current key.

Link copied to clipboard
open fun computePrefix(key: String): String?

Computes the common prefix that is shared by all rows in @completion that start with @key.

Link copied to clipboard
fun connectCursorOnMatch(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (model: TreeModel, iter: TreeIter) -> Boolean): <Error class: unknown class>

Emitted when a match from the cursor is on a match of the list.

Link copied to clipboard
fun connectInsertPrefix(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (prefix: String) -> Boolean): <Error class: unknown class>

Emitted when the inline autocompletion is triggered.

Link copied to clipboard
fun connectMatchSelected(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (model: TreeModel, iter: TreeIter) -> Boolean): <Error class: unknown class>

Emitted when a match from the list is selected.

Link copied to clipboard
fun connectNoMatches(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when the filter model has zero number of rows in completion_complete method.

Link copied to clipboard
open fun getArea(): CellArea?

Returns the underlying GtkCellArea which might be @cell_layout if called on a GtkCellArea or might be null if no GtkCellArea is used by @cell_layout.

Link copied to clipboard
open fun getBuildableId(): String?

Gets the ID of the @buildable object.

Link copied to clipboard
open fun getCells(): <Error class: unknown class>

Returns the cell renderers which have been added to @cell_layout.

Link copied to clipboard

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

Link copied to clipboard
open fun getEntry(): Widget

Gets the entry @completion has been attached to.

Link copied to clipboard
open fun insertPrefix()

Requests a prefix insertion.

Link copied to clipboard
open fun packEnd(cell: CellRenderer, expand: Boolean)

Adds the @cell to the end of @cell_layout. If @expand is false, then the

Link copied to clipboard
open fun packStart(cell: CellRenderer, expand: Boolean)

Packs the @cell into the beginning of @cell_layout. If @expand is false, then the @cell is allocated no more space than it needs. Any unused space is divided evenly between cells for which @expand is true.

Link copied to clipboard
open fun reorder(cell: CellRenderer, position: <Error class: unknown class>)

Re-inserts @cell at @position.

Link copied to clipboard

Sets the GtkCellLayoutDataFunc to use for @cell_layout.

Link copied to clipboard

Sets the match function for @completion to be @func.