Function fltk::dialog::file_chooser

source ·
pub fn file_chooser<P: AsRef<Path>>(
    message: &str,
    pattern: &str,
    dir: P,
    relative: bool
) -> Option<String>
Expand description

Shows a file chooser returning a String. The pattern field takes the same argument the FileChooser::set_filter method. Example:

use fltk::{prelude::*, *};
fn main() {
    let app = app::App::default();
    let mut win = window::Window::default().with_size(900, 300);
    let file = dialog::file_chooser("Choose File", "*.rs", ".", true).unwrap();
    println!("{}", file);
    win.end();
    win.show();
    app.run().unwrap();
}