All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

replace-items Generic Function

Summary

Replaces some items in a collection.

Package

capi

Signature

replace-items collection items &key start new-selection

Arguments
collection
A collection.
items
A list.
start
A non-negative integer.
new-selection
A list specifying the selection.
Description

The generic function replace-items replaces some items in the collection collection from items. replace-items can only be used when the collection has the default items-get-function svref.

start should be a non-negative integer and less than the number of items in collection.

Items in collection are replaced starting at index start, and proceeding until the end of the list items, or the end of the items in collection. If items is too long, the surplus is quietly ignored. replace-items never alters the number of items in the collection.

If supplied, new-selection should be a list of items specifying the new selection in collection. To specify no selection, pass nil.

If new-selection is not supplied, then replace-items attempts to preserve the selection. If some of the selected items are replaced, then the selection on these items is removed, but if a selected item simply moves, then the selection moves with it.

Notes

replace-items cannot be used a graph-pane or a tree-view.

See also

append-items
collection
remove-items
5 Choices - panes with items


CAPI User Guide and Reference Manual (Windows version) - 01 Dec 2021 19:33:57