A pane that displays either a piece of text or an image and when it is pressed it performs an action.
capi
:alternate-callback | |
A callback invoked on Microsoft Windows, Cocoa and GTK+ when pressing the mouse button over the button while a platform-specific modifier key is held down. | |
:press-callback |
A callback invoked on Microsoft Windows, GTK+ and Motif when pressing the mouse button over the button. |
button-alternate-callback
button-press-callback
The class push-button
inherits most of its behavior from button. Note that it is normally best to use a push-button-panel rather than make the individual buttons yourself, as the button panel provides functionality for handling groups of buttons. However, push buttons can be used if you need to have more control over the button's behavior.
press-callback, if non-nil, should be a function which is called when the user presses the mouse left button over the push button. The arguments to press-callback are as specified by callback-type. This initarg is not supported on Cocoa.
alternate-callback, if non-nil, should be a function. On Microsoft Windows and GTK+, it is called instead of callback when the button is clicked with the Control
key held down. On Cocoa, it is called instead of callback when the button is clicked with the Command
key held down. alternate-callback is not implemented for Motif or for other classes of button.
callback (from superclass button) is the general callback, triggered when the user clicks the button, either by pressing and releasing the mouse button or by a keyboard gesture.
press-callback is called only when the user presses the mouse button.
(setq button (capi:contain (make-instance 'capi:push-button :text "Press Me" :data '(:some :data) :callback #'(lambda (data interface) (capi:display-message "Pressed ~S" data))))) (capi:apply-in-pane-process button #'(setf capi:button-enabled) nil button) (capi:apply-in-pane-process button #'(setf capi:button-enabled) t button)
radio-button
check-button
button-panel
push-button-panel
1.2.1 CAPI elements
3.10 Button elements
12 Creating Panes with Your Own Drawing and Input
CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:32:42