The function choice-update-item
updates the display of the item
item
in the choice
choice
. It should be called if the display of
item
(that is, the string returned by the
print-function
) changes.
Create a list panel that displays the status of something
(defun my-print-an-item (item)
(format nil "~a: ~a"
(substitute-if-not #\space
'alphanumericp
(symbol-name item))
(symbol-value item)))
(defvar *status-one* :on)
(defvar *status-two* :off)
(setq list
(capi:contain
(make-instance
'capi:list-panel
:items '(*status-one* *status-two*)
:print-function 'my-print-an-item
:visible-min-height :text-height
:visible-min-width :text-width)))
Setting the status variables does not change the display:
(setq *status-one* :error)
Update the item to change the display:
(capi:choice-update-item list '*status-one*)
This example also demonstrates choice-update-item
:
(example-edit-file "capi/choice/alternative-action-callback")
CAPI User Guide and Reference Manual (Macintosh version) - 3 Aug 2017