A library to display file choosers and message boxes. Supports GNU/Linux, macOS and Windows.
cargo add native-dialog
```rust use native_dialog::{OpenMultipleFile, MessageConfirm, MessageType};
fn main() { let result = OpenMultipleFile::new() .location("~/Desktop") .filter("PNG Image", &["png"]) .filter("JPEG Image", &["jpg", "jpeg"]) .show() .unwrap();
let message = format!("{:#?}", result);
let result = MessageConfirm::new()
.typ(MessageType::Info)
.title("Do you want to open these files?")
.text(&message)
.show()
.unwrap();
assert_eq!(result, true);
} ```
Turn on crate features or embed manifests into the .exe
to enable visual styling and dpi awareness for your program. Check out examples/windowsmanifest and examples/windowsfeatures for example.
The API of macOS has a limitation that all UI operations must be performed on the main thread.