1 CAPI Reference Entries
buttonis a pane that displays either a piece of text or a generic image, and that performs an action when pressed. Certain types of buttons can also be selected and deselected.
selectedis set to
t, the button is initially selected.
The image for the button when disabled (or
nilthe button cannot be selected.
buttonis the class that
check-buttonare built on. It can be displayed either with text or a generic image, and a callback is called when the button is clicked. It inherits all of its textual behavior from
item, including the slot
textwhich is the text that appears in the button. For more details, see
buttonare just buttons with different interaction styles. It can often be easier just to make an instance of
buttonwith the correct interaction (for instance, when the interaction is only known at run-time). The interaction styles are as follows:
A radio button.
A check button.
initarginteraction and the accessor
Called when the button is selected.
Called when the button is deselected.
nil, meaning that the button is a text button, but if
imageis provided then the button displays an image instead of the text. The image can be the name of an image that can be found in the image search path, or an instance of a generic image. The disabled image is the image that is shown when the button is disabled (or
nil, meaning that it is left for the window system to decide how to display the image as disabled). For more details about generic images, see the LispWorks User Guide.
enabledslot, and its associated accessor
button-enabled. This means that when the button is disabled, pressing on it does not call any callbacks or change its selection.
button-panelprovides functionality to group buttons together, and should normally be used in preference to creating individual buttons yourself. For instance, a
radio-button-panelmakes a number of radio buttons and also controls them such that only one button is ever selected at a time.
button-enabledaccessor the button is then enabled and disabled.
(setq button (capi:contain (make-instance 'capi:push-button :text "Press Me")))
(setf (capi:button-enabled button) nil)
(setf (capi:button-enabled button) t)
(setq button (capi:contain (make-instance 'capi:push-button :image "new-lispworks-logo")))
Generated with Harlequin WebMaker