native-dialog
A library to display file choosers and message boxes. Supports GNU/Linux, BSD, macOS and Windows.
Installation
cargo add native-dialog
Usage
use ;
let path = file
.set_location
.add_filter
.add_filter
.open_single_file
.show
.unwrap;
let path = match path ;
// Asyncronous Dialog
let yes = message
.set_level
.set_title
.set_text
.confirm
.spawn
.await
.unwrap;
if yes
Misc
Ugly or blurry dialogs on Windows
Turn on crate features or embed manifests into the .exe
to enable visual styling and dpi awareness for your program. Check out examples/windows_manifest and examples/windows_features for example.
Linux/BSD dependencies
The implementation for Linux and BSD requires either Zenity or Kdialog being installed; otherwise the MissingDep
error will occur.