Closes the top level interface containing a specified pane.
capi
quit-interface pane &key force => result
| pane⇩ |
A CAPI element. |
| force⇩ |
A boolean. The default value is nil. |
| result | t if the interface was closed, nil otherwise. |
The function quit-interface closes the top level interface containing pane, but first it verifies that it is OK to do this by calling the interface's confirm-destroy-function. If it is OK to close the interface, it then calls destroy to do so. If force is true, then neither the confirm-destroy-function or the destroy-callback are called, and the window is just closed immediately.
quit-interface must only be called in the process of the top level interface of pane. Menu callbacks on that interface will be called in that process, but otherwise you probably need to use execute-with-interface or apply-in-pane-process.
Here are two examples demonstrating the use of quit-interface with the destroy-callback and the confirm-destroy-function.
(setq interface (capi:display
(make-instance
'capi:interface
:title "Test Interface"
:destroy-callback
#'(lambda (interface)
(capi:display-message
"Quitting ~S" interface)))))
(capi:apply-in-pane-process
interface 'capi:quit-interface interface)
With this second example, the user is prompted as to whether or not to quit the interface.
(setq interface (capi:display
(make-instance
'capi:interface
:title "Test Interface"
:confirm-destroy-function
#'(lambda (interface)
(capi:confirm-yes-or-no
"Really quit ~S"
interface)))))
(capi:apply-in-pane-process
interface 'capi:quit-interface interface)
CAPI User Guide and Reference Manual (Windows version) - 18 Feb 2025 15:35:34