GCompletion

glib.completion.Completion 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 glib.completion.Completion is created using glib.completion.Completion.new_. Target items are added and removed with glib.completion.Completion.addItems, glib.completion.Completion.removeItems and glib.completion.Completion.clearItems. A completion attempt is requested with glib.completion.Completion.complete or glib.completion.Completion.completeUtf8. When no longer needed, the glib.completion.Completion is freed with glib.completion.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.types.CompletionFunc in glib.completion.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.types.CompletionStrncmpFunc in glib.completion.Completion.setCompare.

glib.completion.Completion has been marked as deprecated, since this API is rarely used and not very actively maintained.

More...

Members

Variables

cache
GList* cache;

the list of items which begin with @prefix.

func
GCompletionFunc func;

function which is called to get the string associated with a target item. It is null if the target items are strings.

items
GList* items;

list of target items (strings or data structures).

prefix
char* prefix;

the last prefix passed to glib.completion.Completion.complete or glib.completion.Completion.completeUtf8.

strncmpFunc
GCompletionStrncmpFunc strncmpFunc;

The function to use when comparing strings. Use glib.completion.Completion.setCompare to modify this function.

Detailed Description

Deprecated: Rarely used API