class GLib::Completion

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.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pointer : Pointer(Void), transfer : GICrystal::Transfer) #

def self.new(data : LibGLib::Completion, transfer : GICrystal::Transfer) #

def self.new(func : GLib::CompletionFunc | Nil = nil, strncmp_func : GLib::CompletionStrncmpFunc | Nil = nil) #

Instance Method Detail

def ==(other : self) : Bool #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


def cache : GLib::List | Nil #

def cache! #

def clear_items : Nil #

DEPRECATED


def complete_utf8(prefix : String, new_prefix : String) : GLib::List #

DEPRECATED


def free : Nil #

DEPRECATED


def func : GLib::CompletionFunc #

def func=(value : GLib::CompletionFunc) #

def items : GLib::List | Nil #

def items! #

def prefix : String | Nil #

def prefix! #

def strncmp_func : GLib::CompletionStrncmpFunc #

def strncmp_func=(value : GLib::CompletionStrncmpFunc) #

def to_unsafe #