1 CAPI Reference Entries
collection
collects together a set of items, and provides functionality for accessing and displaying them.
capi-object
callbacks
choice
items
print-function
A function that prints an item.
test-function
items-count-function
A function which returns the length of items.
items-get-function
A function that returns the nth item.
item-map-function
A function that maps a function over the items.
collection-items
collection-print-function
collection-test-function
collection-items-count-function
collection-items-get-function
collection-items-map-function
collection
is as a part of the classchoice
, which provides selection capabilities on top of the collection handling, and which is used by list panels, button panels and menus amongst others.
print-function
, or can be instances of the CAPI class item in which case they are displayed with the text field of the item. The main difference is that non-CAPI items use the callbacks specified for the collection, whilst the CAPI items will use their callbacks in preference if they are specified.
items-get-function
, anitems-count-function
, and anitem-map-function
. Theitems-get-function
should expect the items and an index, and should return the indexed item. Theitems-count-function
should expect the items and should return the number of them. Theitem-map-function
should expect the items, a function and a flagcollect-results-p
, and should call the function on each of the items in return. Ifcollect-results-p
is non-nil
, then it should also collect the results of these calls together in a list.
push-button-panel
, a subclass ofcollection
.
(capi:contain (make-instance 'capi:push-button-panel :items '(one two three)))(capi:contain (make-instance 'capi:push-button-panel :items '(one two three) :print-function 'string-capitalize))
items
by providing aget-function
and acount-function
.
(capi:contain (make-instance 'capi:push-button-panel :items 6 :items-get-function #'(lambda (items index) (1+ index)) :items-count-function #'(lambda (items) items)))
(defun specific-callback (data interface) (capi:display-message "Specific callback for ~S" data)) (defun generic-callback (data intereface) (capi:display-message "Ordinary callback for ~S" data))(capi:contain (make-instance 'capi:list-panel :items (list (make-instance 'capi:item :text "Special" :data 1000 :selection-callback 'specific-callback) 2 3 4) :selection-callback 'generic-callback) :min-width 200 :min-height 200)
item
count-collection-items
get-collection-item
map-collection-items
search-for-item
Generated with Harlequin WebMaker