LispWorks CAPI Reference Manual > 1 CAPI Reference Entries

NextPrevUpTopContentsIndex

choice-update-item

Function
Summary

Updates an item in a choice.

Package

capi

Signature

choice-update-item choice 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.

Example

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

choice


LispWorks CAPI Reference Manual - 21 Dec 2009

NextPrevUpTopContentsIndex