Next Prev Up Top Contents Index

prompt-with-list

Function
Summary

The prompt-with-list function prompts the user to make a choice from a list. By default the choice is a list panel.

Syntax
prompt-with-list items
 message
                 &key
                 choice-class
 interaction
 value-function
                 pane-args
 popup-args
Description

This function prompts the user with a list of items from which they must select a certain number. By default, the user is prompted with a single selection list panel, but the class of pane (which must be a choice) can be specified using choice-class , and the interaction can be specified with interaction . The value that is returned is usually the selected items, but a value-function can be supplied that gets passed the result and can then return a new result.

The initial selection can be specified using choice initargs :selection , :selected-item or :selected-items .

For single selection, the dialog has an OK and a Cancel button, while for other selections it has Yes , No and Cancel buttons where Yes means accept the selection, No means accept a null selection and Cancel behaves as normal.

Finally, as with all of the prompting functions, the prompter is created by passing an appropriate pane (in this case an instance of class choice-class ) to popup-confirmer . Arguments can be passed to the make-instance of the pane and the call to popup-confirmer using pane-args and popup-args respectively.

Examples
(capi:prompt-with-list
  '(1 2 3 4 5) "Select an item:")
(capi:prompt-with-list
 '(1 2 3 4 5) "Select some items:"
 :interaction :multiple-selection
 :selection '(0 2 4))
(capi:prompt-with-list
 '(1 2 3 4 5) "Select an item:"
 :interaction :multiple-selection
 :choice-class 'capi:button-panel)
(capi:prompt-with-list
  '(1 2 3 4 5) "Select an item:"
  :interaction :multiple-selection
  :choice-class 'capi:button-panel
  :pane-args
  '(:layout-class capi:column-layout))
See also

popup-confirmer
list-panel
choice


LispWorks CAPI Reference Manual - 14 Dec 2001

Next Prev Up Top Contents Index