class GLib::Completion
- GLib::Completion
- Reference
- Object
Overview
GCompletion
provides support for automatic completion of a string
using any group of target strings. It is typically used for file
name completion as is common in many UNIX shells.
A GCompletion
is created using GLib::Completion.new
. Target items are
added and removed with GLib::Completion#add_items
,
GLib::Completion#remove_items
and
GLib::Completion#clear_items
. A completion attempt is requested with
GLib::Completion#complete
or [method@GLib.Completion.complete_utf8].
When no longer needed, the GCompletion
is freed with
GLib::Completion#free
.
Items in the completion can be simple strings (e.g. filenames), or
pointers to arbitrary data structures. If data structures are used
you must provide a GLib::CompletionFunc
in GLib::Completion.new
,
which retrieves the item’s string from the data structure. You can change
the way in which strings are compared by setting a different
GLib::CompletionStrncmpFunc
in GLib::Completion#compare=
.
GCompletion
has been marked as deprecated, since this API is rarely
used and not very actively maintained.
Defined in:
lib/gi-crystal/src/auto/g_lib-2.0/completion.crConstructors
- .new(pointer : Pointer(Void), transfer : GICrystal::Transfer)
- .new(data : LibGLib::Completion, transfer : GICrystal::Transfer)
- .new(func : GLib::CompletionFunc | Nil = nil, strncmp_func : GLib::CompletionStrncmpFunc | Nil = nil)
Instance Method Summary
-
#==(other : self) : Bool
Returns
true
if this reference is the same as other. - #cache : GLib::List | Nil
- #cache!
-
#clear_items : Nil
DEPRECATED
-
#complete_utf8(prefix : String, new_prefix : String) : GLib::List
DEPRECATED
-
#free : Nil
DEPRECATED
- #func : GLib::CompletionFunc
- #func=(value : GLib::CompletionFunc)
- #items : GLib::List | Nil
- #items!
- #prefix : String | Nil
- #prefix!
- #strncmp_func : GLib::CompletionStrncmpFunc
- #strncmp_func=(value : GLib::CompletionStrncmpFunc)
- #to_unsafe
Constructor Detail
Instance Method Detail
Returns true
if this reference is the same as other. Invokes same?
.