8.1.22 The editable-list Widget

Syntax:

type ::= (editable-list [keyword argument]... type)

A widget that can hold a variable list of widgets of the same type, represented by type. Its super is the default widget.

It either overrides or adds the following properties:

:convert-widget

As other composite widgets, a function that takes care of converting each type in type.

:copy

A function to copy the types given in type.

:entry-format

This string will be inserted for each entry in the list. The following ‘%’ escapes are available:

%v

This will be replaced with the buffer representation of the type widget.

%i

Insert the [INS] button, a widget of type insert-button.

%d

Insert the [DEL] button, a widget of type delete-button.

%%

Insert a literal ‘%’.

:insert-button-args

A list of keyword arguments to pass to the insert buttons.

:delete-button-args

A list of keyword arguments to pass to the delete buttons.

:append-button-args

A list of keyword arguments to pass to the trailing insert button.

:buttons

The widgets representing the insert and delete buttons.

:format

By default, insert its value and at the and adds an insert button.

This is useful so that new elements can be added to the list upon user request.

:format-handler

A function that recognize the escape for inserting an insert button.

:offset

By default, this widget has an offset of 12.

:children

The widgets representing the elements of the list.

:args

List whose CAR is the type of the list elements.

:insert-before

Function to insert a new widget as a child of the editable-list widget.

This function inserts a recently deleted child, if there is one. That is useful, so that the user can move elements in a list easily. If there is not a recently deleted child, it inserts a child with its default value.

:delete-at

Function to delete a child from the widget, and store it into the :last-deleted list, so that it can be reinserted when the :insert-before function executes.

:value-create

The function that takes care of inserting all values.

:value-get

Function that returns a list with the value of the child widgets.

:validate

This widget validates if all children validate.

:match

To match, the value must be a list and all the list members must match the specified type.

:match-inline

Like the :match function, but taking into account inline values and widgets.