builder_open_jpg/
builder_open_jpg.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extern crate nfd;

use nfd::Response;

fn main() {
    let result = nfd::dialog().filter("jpg").open().unwrap_or_else(|e| {
        panic!(e);
    });

    match result {
        Response::Okay(file_path) => println!("File path = {:?}", file_path),
        Response::Cancel => println!("User canceled"),
        _ => (),
    }
}