Type Alias NativeFileChooser

pub type NativeFileChooser = FileDialog;
Available on crate feature dep_fltk only.
Expand description

FLTK’s NativeFileChooser

Aliased Type§

struct NativeFileChooser { /* private fields */ }

Implementations

§

impl FileDialog

pub fn new(op: FileDialogType) -> FileDialog

Creates an new file dialog

pub fn filename(&self) -> PathBuf

Returns the chosen file name

pub fn filenames(&self) -> Vec<PathBuf>

Returns the chosen file names

pub fn directory(&self) -> PathBuf

Returns the preset directory

pub fn set_directory<P>(&mut self, dir: &P) -> Result<(), FltkError>
where P: AsRef<Path>,

Sets the starting directory

§Errors

Errors on non-existent path

pub fn try_show(&mut self) -> Result<FileDialogAction, FltkError>

Shows the file dialog

pub fn show(&mut self)

Shows the file dialog

pub fn set_option(&mut self, opt: FileDialogOptions)

Sets the option for the dialog

pub fn set_type(&mut self, op: FileDialogType)

Sets the type for the dialog

pub fn set_title(&mut self, title: &str)

Sets the title for the dialog

pub fn set_filter(&mut self, f: &str)

Sets the filter for the dialog, can be: A single wildcard (e.g. "*.txt"). Multiple wildcards (e.g. "*.{cxx,h,H}"). A descriptive name followed by a \t and a wildcard (e.g. "Text Files\t*.txt"). A list of separate wildcards with a \n between each (e.g. "*.{cxx,H}\n*.txt"). A list of descriptive names and wildcards (e.g. "C++ Files\t*.{cxx,H}\nTxt Files\t*.txt")

pub fn set_preset_file(&mut self, f: &str)

Sets the default filename for the dialog

pub fn error_message(&self) -> Option<String>

returns the error message from the file dialog

Trait Implementations

§

impl Debug for FileDialog

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Drop for FileDialog

§

fn drop(&mut self)

Executes the destructor for this type. Read more