All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

NextPrevUpTopContentsIndex

prompt-for-confirmation

Function
Summary

Displays a dialog box with a message and Yes and No buttons.

Package

capi

Signature

prompt-for-confirmation message &key screen owner cancel-button default-button continuation => result , successp

Arguments

message

A string.

screen

A screen.

owner

An owner window.

cancel-button

A boolean.

default-button

A keyword, or nil.

continuation

A function or nil.

Values

result

A boolean.

successp

A boolean.

Description

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:

cancel-button specifies whether a Cancel button also appears on the dialog. When Cancel is pressed, abort is called and the dialog is dismissed. 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.

owner specifies an owner window for the dialog. See 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. The continuation function 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.

Example
(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)))
See also

confirm-yes-or-no
Dialogs: Prompting for Input


CAPI User Guide and Reference Manual (Unix version) - 3 Aug 2017

NextPrevUpTopContentsIndex