Displays a dialog box with a message and Yes and No buttons.
capi
prompt-for-confirmation message &key screen owner cancel-button default-button continuation => result, successp
| message⇩ |
A string. |
| screen⇩ |
A screen, or any argument accepted by convert-to-screen. |
| owner⇩ |
An owner window. |
| cancel-button⇩ |
A boolean. |
| default-button⇩ |
A keyword, or nil. |
| continuation⇩ |
A function or nil. |
| result⇩ |
A boolean. |
| successp⇩ |
A boolean. |
The function prompt-for-confirmation displays a dialog box containing message, with Yes and No buttons. When either Yes or No is pressed, it returns two values:
t (for compatibility with other prompt functions).
cancel-button specifies whether a Cancel button also appears on the dialog. When Cancel is pressed, the dialog is dismissed and prompt-for-confirmation returns nil for both result and successp. The default value of cancel-button is nil.
default-button specifies which button has the input focus when the dialog appears (and is thus selected when the user immediately presses Return).The value :ok means Yes, the value :cancel means Cancel, and any other value means No. The default value of default-button is nil.
screen specifies a CAPI screen on which to display the dialog. owner specifies an owner window for the dialog. See 10 Dialogs: Prompting for Input for details.
If continuation is non-nil, then it must be a function with a lambda list that accepts two arguments. continuation is called with the values that would normally be returned by prompt-for-continuation. On Cocoa, passing continuation causes the dialog to be made as a window-modal sheet and prompt-for-confirmation returns immediately, leaving the dialog on the screen. The with-dialog-results macro provides a convenient way to create a continuation function.
(capi:prompt-for-confirmation "Continue?")
(multiple-value-bind (res success)
(capi:prompt-for-confirmation "Yes, No or Cancel"
:cancel-button t)
(if success
res
(abort)))
CAPI User Guide and Reference Manual (Windows version) - 18 Feb 2025 15:35:34