1 CAPI Reference Entries
button
is 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.
simple-pane
item
push-button
radio-button
check-button
interaction
selected
selected
is set tot
, the button is initially selected.
callback
image
nil
).
disabled-image
The image for the button when disabled (ornil
).
enabled
nil
the button cannot be selected.
button-enabled
button-selected
button-image
button-disabled-image
button
is the class thatpush-button
,radio-button
, andcheck-button
are 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 fromitem
, including the slottext
which is the text that appears in the button. For more details, see item
.
button
are just buttons with different interaction styles. It can often be easier just to make an instance ofbutton
with the correct interaction (for instance, when the interaction is only known at run-time). The interaction styles are as follows:
:no-selection
:single-selection
A radio button.
:multiple-selection
A check button.
initarg
interaction and the accessorbutton-selected
.
:callback
:selection-callback
Called when the button is selected.
:retract-callback
Called when the button is deselected.
image
anddisabled-image
arenil
, meaning that the button is a text button, but ifimage
is 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 (ornil
, 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.
enabled
slot, and its associated accessorbutton-enabled
. This means that when the button is disabled, pressing on it does not call any callbacks or change its selection.
button-panel
provides functionality to group buttons together, and should normally be used in preference to creating individual buttons yourself. For instance, aradio-button-panel
makes a number of radio buttons and also controls them such that only one button is ever selected at a time.
button-enabled
accessor 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")))
capi/elements/buttons.lisp
button-panel
callbacks
Generated with Harlequin WebMaker