EntryCompletion

open class EntryCompletion : GLibObject.Object, EntryCompletionProtocol

GtkEntryCompletion is an auxiliary object to be used in conjunction with GtkEntry to provide the completion functionality. It implements the GtkCellLayout 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 gtk_entry_completion_set_text_column()), but this can be overridden with a custom match function (see gtk_entry_completion_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 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 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 GtkEntryCompletion::action-activated signal is emitted.

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

The EntryCompletion type acts as a reference-counted owner of an underlying GtkEntryCompletion instance. It provides the methods that can operate on this data type through EntryCompletionProtocol conformance. Use EntryCompletion as a strong reference or owner of a GtkEntryCompletion instance.

  • Designated initialiser from the underlying `C` data type.
    

    This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the EntryCompletion instance.

    Declaration

    Swift

    @inlinable
    public init(_ op: UnsafeMutablePointer<GtkEntryCompletion>)

    Parameters

    op

    pointer to the underlying object

  • Designated initialiser from a constant pointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the EntryCompletion instance.

    Declaration

    Swift

    @inlinable
    public init(_ op: UnsafePointer<GtkEntryCompletion>)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from a non-mutating gpointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the EntryCompletion instance.

    Declaration

    Swift

    @inlinable
    override public init!(gpointer op: gpointer?)

    Parameters

    op

    gpointer to the underlying object

  • Optional initialiser from a non-mutating gconstpointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the EntryCompletion instance.

    Declaration

    Swift

    @inlinable
    override public init!(gconstpointer op: gconstpointer?)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from a constant pointer to the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the EntryCompletion instance.

    Declaration

    Swift

    @inlinable
    public init!(_ op: UnsafePointer<GtkEntryCompletion>?)

    Parameters

    op

    pointer to the underlying object

  • Optional initialiser from the underlying C data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the EntryCompletion instance.

    Declaration

    Swift

    @inlinable
    public init!(_ op: UnsafeMutablePointer<GtkEntryCompletion>?)

    Parameters

    op

    pointer to the underlying object

  • Designated initialiser from the underlying C data type. Will retain GtkEntryCompletion. i.e., ownership is transferred to the EntryCompletion instance.

    Declaration

    Swift

    @inlinable
    public init(retaining op: UnsafeMutablePointer<GtkEntryCompletion>)

    Parameters

    op

    pointer to the underlying object

  • Reference intialiser for a related type that implements EntryCompletionProtocol Will retain GtkEntryCompletion.

    Declaration

    Swift

    @inlinable
    public init<T>(entryCompletion other: T) where T : EntryCompletionProtocol

    Parameters

    other

    an instance of a related type that implements EntryCompletionProtocol

  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EntryCompletionProtocol.

    Declaration

    Swift

    @inlinable
    override public init<T>(cPointer p: UnsafeMutablePointer<T>)

    Parameters

    cPointer

    pointer to the underlying object

  • Unsafe typed, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EntryCompletionProtocol.

    Declaration

    Swift

    @inlinable
    override public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>)

    Parameters

    cPointer

    pointer to the underlying object

  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EntryCompletionProtocol.

    Declaration

    Swift

    @inlinable
    override public init(raw p: UnsafeRawPointer)

    Parameters

    p

    raw pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EntryCompletionProtocol.

    Declaration

    Swift

    @inlinable
    override public init(retainingRaw raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EntryCompletionProtocol.

    Declaration

    Swift

    @inlinable
    public required init(raw p: UnsafeMutableRawPointer)

    Parameters

    p

    mutable raw pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EntryCompletionProtocol.

    Declaration

    Swift

    @inlinable
    required public init(retainingRaw raw: UnsafeMutableRawPointer)

    Parameters

    raw

    mutable raw pointer to the underlying object

  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EntryCompletionProtocol.

    Declaration

    Swift

    @inlinable
    override public init(opaquePointer p: OpaquePointer)

    Parameters

    p

    opaque pointer to the underlying object

  • Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to EntryCompletionProtocol.

    Declaration

    Swift

    @inlinable
    override public init(retainingOpaquePointer p: OpaquePointer)

    Parameters

    p

    opaque pointer to the underlying object

  • Creates a new GtkEntryCompletion object.

    Declaration

    Swift

    @inlinable
    public init()
  • Creates a new GtkEntryCompletion object using the specified area to layout cells in the underlying GtkTreeViewColumn for the drop-down menu.

    Declaration

    Swift

    @inlinable
    public init<CellAreaT>(area: CellAreaT) where CellAreaT : CellAreaProtocol
  • Creates a new GtkEntryCompletion object using the specified area to layout cells in the underlying GtkTreeViewColumn for the drop-down menu.

    Declaration

    Swift

    @inlinable
    public static func newWith<CellAreaT>(area: CellAreaT) -> EntryCompletion! where CellAreaT : CellAreaProtocol