Struct im_native_dialog::ImNativeFileDialog[][src]

pub struct ImNativeFileDialog<T> { /* fields omitted */ }
Expand description

A wrapper around FileDialog for use with immediate mode gui libraries. The show*() methods create a FileDialog in a new thread, and the result is returned to this object via crossbeam_channel, ready to be polled by the ui using ImNativeFileDialog::check()

Implementations

impl ImNativeFileDialog<Vec<PathBuf>>[src]

pub fn show_open_multiple_file(
    &mut self,
    location: Option<PathBuf>
) -> Result<(), ImNativeDialogError>
[src]

Shows a dialog that let users to open multiple files using FileDialog::show_open_multiple_file().

impl ImNativeFileDialog<Option<PathBuf>>[src]

pub fn open_single_dir(
    &mut self,
    location: Option<PathBuf>
) -> Result<(), ImNativeDialogError>
[src]

Shows a dialog that let users to open one directory using FileDialog::show_open_single_dir().

pub fn open_single_file(
    &mut self,
    location: Option<PathBuf>
) -> Result<(), ImNativeDialogError>
[src]

Shows a dialog that let users to open one file using FileDialog::show_open_single_file().

pub fn show_save_single_file(
    &mut self,
    location: Option<PathBuf>
) -> Result<(), ImNativeDialogError>
[src]

Shows a dialog that let users to save one file using FileDialog::show_save_single_file().

impl<T: Send + 'static + Default> ImNativeFileDialog<T>[src]

pub fn with_callback<C>(&mut self, callback: C) -> &mut Self where
    C: FnOnce(&Result<T, Error>) + Send + 'static, 
[src]

Set a callback to use for this dialog which will be called immediately upon dialog close in the dialog monitoring thread.

pub fn show<F: FnOnce(Sender<Result<T, Error>>, FileDialog<'_>, Box<dyn FnOnce(&Result<T, Error>)>) + Send + 'static>(
    &mut self,
    run: F
) -> Result<(), ImNativeDialogError>
[src]

Show a customized version of FileDialog, use the run closure to customize the dialog and show the dialog. This closure runs in its own thread.

pub fn check(&mut self) -> Option<Result<T, Error>>[src]

Check if the dialog is complete. If it is complete it will return Some with the result of the dialog, otherwise will return None. This will update the status of ImNativeFileDialog::is_open().

pub fn is_open(&self) -> bool[src]

Returns true if the dialog is currently open, otherwise returns false. Requires a previous call of ImNativeFileDialog::check() to update the current status.

Trait Implementations

impl<T> Default for ImNativeFileDialog<T>[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

Auto Trait Implementations

impl<T> !RefUnwindSafe for ImNativeFileDialog<T>

impl<T> Send for ImNativeFileDialog<T> where
    T: Send

impl<T> !Sync for ImNativeFileDialog<T>

impl<T> Unpin for ImNativeFileDialog<T> where
    T: Unpin

impl<T> !UnwindSafe for ImNativeFileDialog<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.