pub fn confirm<R: Runtime, F: FnOnce(bool) + Send + 'static>(
parent_window: Option<&Window<R>>,
title: impl AsRef<str>,
message: impl AsRef<str>,
f: F
)
Available on crate feature
dialog
only.Expand description
Displays a non-blocking dialog with a message and an optional title with an “ok” and a “cancel” button.
This is not a blocking operation, and should be used when running on the main thread to avoid deadlocks with the event loop.
Examples
use tauri::api::dialog::confirm;
confirm(Some(&window), "Tauri", "Are you sure?", |answer| {
// do something with `answer`
});