Class
GtkEntryCompletion
deprecated: 4.10
Description [src]
final class Gtk.EntryCompletion : GObject.Object
implements Gtk.Buildable, Gtk.CellLayout {
/* No available fields */
}
GtkEntryCompletion
is an auxiliary object to provide completion functionality
for GtkEntry
.
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()
.
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 GtkCellLayoutDataFunc
or
[signal@Gtk.CellArea::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.
Deprecated since: 4.10
Please do not use it in newly written code.
Constructors
gtk_entry_completion_new_with_area
Creates a new GtkEntryCompletion
object using the
specified area
.
deprecated: 4.10
Instance methods
gtk_entry_completion_complete
Requests a completion operation, or in other words a refiltering of the current list with completions, using the current key.
deprecated: 4.10
gtk_entry_completion_compute_prefix
Computes the common prefix that is shared by all rows in completion
that start with key
.
deprecated: 4.10
gtk_entry_completion_get_completion_prefix
Get the original text entered by the user that triggered
the completion or NULL
if there’s no completion ongoing.
deprecated: 4.10
gtk_entry_completion_get_inline_completion
Returns whether the common prefix of the possible completions should be automatically inserted in the entry.
deprecated: 4.10
gtk_entry_completion_get_inline_selection
Returns TRUE
if inline-selection mode is turned on.
deprecated: 4.10
gtk_entry_completion_get_minimum_key_length
Returns the minimum key length as set for completion
.
deprecated: 4.10
gtk_entry_completion_get_model
Returns the model the GtkEntryCompletion
is using as data source.
deprecated: 4.10
gtk_entry_completion_get_popup_completion
Returns whether the completions should be presented in a popup window.
deprecated: 4.10
gtk_entry_completion_get_popup_set_width
Returns whether the completion popup window will be resized to the width of the entry.
deprecated: 4.10
gtk_entry_completion_get_popup_single_match
Returns whether the completion popup window will appear even if there is only a single match.
deprecated: 4.10
gtk_entry_completion_get_text_column
Returns the column in the model of completion
to get strings from.
deprecated: 4.10
gtk_entry_completion_set_inline_completion
Sets whether the common prefix of the possible completions should be automatically inserted in the entry.
deprecated: 4.10
gtk_entry_completion_set_inline_selection
Sets whether it is possible to cycle through the possible completions inside the entry.
deprecated: 4.10
gtk_entry_completion_set_match_func
Sets the match function for completion
to be func
.
deprecated: 4.10
gtk_entry_completion_set_minimum_key_length
Requires the length of the search key for completion
to be at least
length
.
deprecated: 4.10
gtk_entry_completion_set_popup_completion
Sets whether the completions should be presented in a popup window.
deprecated: 4.10
gtk_entry_completion_set_popup_set_width
Sets whether the completion popup window will be resized to be the same width as the entry.
deprecated: 4.10
gtk_entry_completion_set_popup_single_match
Sets whether the completion popup window will appear even if there is only a single match.
deprecated: 4.10
gtk_entry_completion_set_text_column
Convenience function for setting up the most used case of this code: a completion list with just strings.
deprecated: 4.10
Methods inherited from GtkBuildable (1)
Methods inherited from GtkCellLayout (10)
gtk_cell_layout_add_attribute
Adds an attribute mapping to the list in cell_layout
.
deprecated: 4.10
gtk_cell_layout_clear
Unsets all the mappings on all renderers on cell_layout
and
removes all renderers from cell_layout
.
deprecated: 4.10
gtk_cell_layout_clear_attributes
Clears all existing attributes previously set with gtk_cell_layout_set_attributes().
deprecated: 4.10
gtk_cell_layout_get_area
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
.
deprecated: 4.10
gtk_cell_layout_get_cells
Returns the cell renderers which have been added to cell_layout
.
deprecated: 4.10
gtk_cell_layout_pack_end
Adds the cell
to the end 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
.
deprecated: 4.10
gtk_cell_layout_pack_start
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
.
deprecated: 4.10
gtk_cell_layout_reorder
Re-inserts cell
at position
.
deprecated: 4.10
gtk_cell_layout_set_attributes
Sets the attributes in the parameter list as the attributes
of cell_layout
.
deprecated: 4.10
gtk_cell_layout_set_cell_data_func
Sets the GtkCellLayout
DataFunc to use for cell_layout
.
deprecated: 4.10
Properties
Gtk.EntryCompletion:inline-completion
Determines whether the common prefix of the possible completions should be inserted automatically in the entry.
Gtk.EntryCompletion:inline-selection
Determines whether the possible completions on the popup will appear in the entry as you navigate through them.
Gtk.EntryCompletion:popup-completion
Determines whether the possible completions should be shown in a popup window.
Gtk.EntryCompletion:popup-set-width
Determines whether the completions popup window will be resized to the width of the entry.
Gtk.EntryCompletion:popup-single-match
Determines whether the completions popup window will shown for a single possible completion.
Signals
Gtk.EntryCompletion::cursor-on-match
Emitted when a match from the cursor is on a match of the list.
Gtk.EntryCompletion::no-matches
Emitted when the filter model has zero number of rows in completion_complete method.
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.