Skip to content

How to open "dialog with message" from Rust? #9642

Closed Answered by FabianLars
EGSP asked this question in Q&A
Discussion options

You must be logged in to vote

The rust documentation is on docs.rs: https://docs.rs/tauri/latest/tauri/api/dialog/fn.message.html / https://docs.rs/tauri/latest/tauri/api/dialog/blocking/fn.message.html

The docs are generally stil lacking but in this case i think there isn't that much to show. Here's an in-code example (for ask but message is almost the same)

ask(
Some(&window),
"Tauri API",
"Are you sure that you want to close this window?",
move |answer| {
if answer {
// .close() cannot be called on the main thread
std::thread::spawn(move || {
app_handle.get_window(&label).unwrap().close().unwrap();

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@EGSP
Comment options

@FabianLars
Comment options

@EGSP
Comment options

@EGSP
Comment options

Answer selected by EGSP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants