confirm

fun ControlManager.confirm(message: String, title: String? = null, confirmLabel: String = "OK", cancelLabel: String = "Cancel", destructive: Boolean = false, onResult: (Boolean) -> Unit): Dialog(source)

Asks to confirm message in a modal dialog, under title when it is set, with the buttons cancelLabel and confirmLabel. onResult is called once, when the dialog closes: with true when it is confirmed, false when it is cancelled, by its button, escape, a click on the backdrop or Dialog.close. Enter presses the button with the keyboard focus, which starts on the confirming button, or on the cancelling one when the action is destructive.

The dialog is a dialog.confirm, its buttons are in a dialog-buttons: a .cancel-button and a .confirm-button, which is .destructive when destructive is set.


suspend fun ControlManager.confirm(message: String, title: String? = null, confirmLabel: String = "OK", cancelLabel: String = "Cancel", destructive: Boolean = false): Boolean(source)

Asks to confirm message like the confirm that takes a callback, and suspends until the dialog closes: true when it is confirmed, false when it is cancelled. Cancelling the coroutine closes the dialog. For use in a coroutine on the thread of the program, like one that launch starts.