Next Previous Up Top Contents Index

1 CAPI Reference Entries

choice-selected-items

Generic Function

Summary

The functionchoice-selected-items returns the currently selected items in a choice as a list of the items.
Syntax

choice-selected-items choice

Description

The functionchoice-selected-items returns the currently selected items in a choice as a list of the items. Asetf method is provided as a means of setting the currently selected items. In the case ofsingle-selection choices, it is usually easier to use the complementary functionchoice-selected-item, which returns the selected item as its result.
Compatibility Note

In LispWorks 3.1,choice-selected-items returned a single item forsingle-selection list panels but this was considered to cause problems and so it was changed to always return a list, and the alternative functionchoice-selected-item was provided for single selection panes.
Examples

First we set up a multiple selection choice -- in this case, a list panel.
(setq list (capi:contain
            (make-instance 
             capi:list-panel
             :items '(a b c d e)
             :interaction :multiple-selection
             :selection '(1 3))))

The following code line returns the selections of the list.
(capi:choice-selected-items list)

The selections of the list panel can be changed and redisplayed using the following code.
(setf (capi:choice-selected-items list) '(a c e))
(capi:choice-selected-items list)

See also

choice
choice-selected-item

LispWorks CAPI Reference Manual - 17 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker