pub fn select_folder_dialog(title: &str, path: &str) -> Option<String>
Examples found in repository?
examples/main.rs (line 41)
5fn main() {
6
7 let choice = tinyfiledialogs::message_box_yes_no("hello", "yes or no?",
8 MessageBoxIcon::Question, YesNo::No);
9
10 let user_input: String;
11 match tinyfiledialogs::input_box("Enter user name", "Username:", "") {
12 Some(input) => user_input = input,
13 None => user_input = "null".to_string(),
14 }
15
16 let user_input_2: String;
17 match tinyfiledialogs::input_box("Re-enter user name", "Username:", &user_input) {
18 Some(input) => user_input_2 = input,
19 None => user_input_2 = "null".to_string(),
20 }
21
22 let password_input: String;
23 match tinyfiledialogs::password_box("Enter password", "Password:") {
24 Some(input) => password_input = input,
25 None => password_input = "null".to_string(),
26 }
27
28 let save_file: String;
29 match tinyfiledialogs::save_file_dialog("Save", "password.txt") {
30 Some(file) => save_file = file,
31 None => save_file = "null".to_string(),
32 }
33
34 let open_file: String;
35 match tinyfiledialogs::open_file_dialog("Open", "password.txt", None) {
36 Some(file) => open_file = file,
37 None => open_file = "null".to_string(),
38 }
39
40 let folder: String;
41 match tinyfiledialogs::select_folder_dialog("Select folder", "") {
42 Some(result) => folder = result,
43 None => folder = "null".to_string(),
44 }
45
46 let color: String;
47 match tinyfiledialogs::color_chooser_dialog("Choose a Color", DefaultColorValue::Hex("#FF0000")) {
48 Some((hex_result, _rgb)) => color = hex_result,
49 None => color = "null".to_string(),
50 }
51
52 println!("Choice {:?}", choice);
53 println!("User input {:?}", user_input);
54 println!("User input 2 {:?}", user_input_2);
55 println!("Password input {:?}", password_input);
56 println!("Save file {:?}", save_file);
57 println!("Open file {:?}", open_file);
58 println!("folder {:?}", folder);
59 println!("color {:?}", color);
60}