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

abort-dialog Function

Summary

Aborts the current dialog.

Package

capi

Signature

abort-dialog &rest ignored-args

Arguments
ignored-args
Lisp objects.
Description

The function abort-dialog aborts the current dialog. For example, it can be made a selection callback from a Cancel button so that pressing the button aborts the dialog. In a similar manner the complementary function exit-dialog can be used as a callback for an OK button.

The arguments in ignored-args are all ignored.

If there is no current dialog then abort-dialog does nothing and returns nil. If there is a current dialog then abort-dialog either returns non-nil or does a non-local exit. Therefore code that depends on abort-dialog returning must be written carefully. Constructs like this can be useful:

(unless (capi:abort-dialog)
  (foo))

Above, foo will be called only if there is no current dialog.

It is not useful to do either:

(when (capi:abort-dialog)
  (foo))

or:

(progn
  (capi:abort-dialog)
  (foo))

as in both cases it is not well-defined whether foo will be called if there is a current dialog.

Examples
(capi:display-dialog
  (capi:make-container
    (make-instance 'capi:push-button
                   :text "Cancel"
                   :callback 'capi:abort-dialog)
                   :title "Test Dialog"))

Also see these examples:

(example-edit-file "capi/dialogs/")
See also

exit-dialog
display-dialog
popup-confirmer
interface
10 Dialogs: Prompting for Input


CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:32:42