All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

choice-update-item Function

Summary

Updates an item in a choice.

Package

capi

Signature

choice-update-item choice item

Arguments
choice
A choice.
item
An item.
Description

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.

Examples

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")
See also

choice


CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:27