EntryCompletion

open class EntryCompletion : GLibObject.Object, EntryCompletionProtocol

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

It implements the [ifaceGtk.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 [methodGtk.EntryCompletion.set_text_column]), but this can be overridden with a custom match function (see [methodGtk.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 [signalGtk.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 [methodGtk.Entry.set_completion].

GtkEntryCompletion uses a [classGtk.TreeModelFilter] model to represent the subset of the entire model that is currently matching. While the GtkEntryCompletion signals [signalGtk.EntryCompletion::match-selected] and [signalGtk.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 [signalGtk.CellArea::apply-attributes)] will generally take the filter model as argument. As long as you are only calling [methodGtk.TreeModel.get], this will make no difference to you. If for some reason, you need the original model, use [methodGtk.TreeModelFilter.get_model]. Don’t forget to use [methodGtk.TreeModelFilter.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.

    The GtkCellArea is used 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.

    The GtkCellArea is used 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