1 CAPI Reference Entries

item

Class

Summary

The classitem groups together a title, some data and some callbacks into a single object for use in collections and choices.

Superclasses

callbacks
capi-object

Subclasses

menu-item
button
item-pinboard-object

Slots

data
The data associated with the item.

text
The text to appear in the item (ornil).

print-function

If no text, this is called to print the data.

selected
Ift the item is selected.

Accessors

item-data
item-text
item-print-function
item-selected

Description

An item can provide its own callbacks to override those specified in its enclosing collection, and can also provide some data to get passed to those callbacks. An item is displayed as a string using its text if specified, or else by calling a print function on the item's data. Theprint-function will either be the one specified in the item, or else theprint-function for its parent collection.

Theselected slot in an item is non-nil if the item is currently selected. The accessoritem-selected is provided to access and to set this value.

Example

(defun main-callback (data interface)
  (capi:display-message "Main callback: ~S"
                        data))

(defun item-callback (data interface) (capi:display-message "Item callback: ~S" data))

(capi:contain (make-instance 'capi:list-panel :items (list (make-instance 'capi:item :text "Item" :data '(some data) :selection-callback 'item-callback) "Non-Item 1" "Non-Item 2") :selection-callback 'main-callback))

See Also

itemp
collection
choice


CAPI Reference Manual, Liquid Common Lisp Version 5.0 - 3 OCT 1997

Generated with Harlequin WebMaker