pub struct ImNativeFileDialog<T> { /* private fields */ }
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§
Source§impl ImNativeFileDialog<Vec<PathBuf>>
impl ImNativeFileDialog<Vec<PathBuf>>
Sourcepub fn show_open_multiple_file(
&mut self,
location: Option<PathBuf>,
) -> Result<(), ImNativeDialogError>
pub fn show_open_multiple_file( &mut self, location: Option<PathBuf>, ) -> Result<(), ImNativeDialogError>
Shows a dialog that let users to open multiple files using FileDialog::show_open_multiple_file().
Source§impl ImNativeFileDialog<Option<PathBuf>>
impl ImNativeFileDialog<Option<PathBuf>>
Sourcepub fn open_single_dir(
&mut self,
location: Option<PathBuf>,
) -> Result<(), ImNativeDialogError>
pub fn open_single_dir( &mut self, location: Option<PathBuf>, ) -> Result<(), ImNativeDialogError>
Shows a dialog that let users to open one directory using FileDialog::show_open_single_dir().
Sourcepub fn open_single_file(
&mut self,
location: Option<PathBuf>,
) -> Result<(), ImNativeDialogError>
pub fn open_single_file( &mut self, location: Option<PathBuf>, ) -> Result<(), ImNativeDialogError>
Shows a dialog that let users to open one file using FileDialog::show_open_single_file().
Sourcepub fn show_save_single_file(
&mut self,
location: Option<PathBuf>,
) -> Result<(), ImNativeDialogError>
pub fn show_save_single_file( &mut self, location: Option<PathBuf>, ) -> Result<(), ImNativeDialogError>
Shows a dialog that let users to save one file using FileDialog::show_save_single_file().
Source§impl<T: Send + 'static + Default> ImNativeFileDialog<T>
impl<T: Send + 'static + Default> ImNativeFileDialog<T>
Sourcepub fn with_callback<C>(&mut self, callback: C) -> &mut Self
pub fn with_callback<C>(&mut self, callback: C) -> &mut Self
Set a callback to use for this dialog which will be called immediately upon dialog close in the dialog monitoring thread.
Sourcepub fn show<F: FnOnce(Sender<Result<T, Error>>, FileDialog<'_>, Box<dyn FnOnce(&Result<T, Error>)>) + Send + 'static>(
&mut self,
run: F,
) -> Result<(), ImNativeDialogError>
pub fn show<F: FnOnce(Sender<Result<T, Error>>, FileDialog<'_>, Box<dyn FnOnce(&Result<T, Error>)>) + Send + 'static>( &mut self, run: F, ) -> Result<(), ImNativeDialogError>
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.
Sourcepub fn check(&mut self) -> Option<Result<T, Error>>
pub fn check(&mut self) -> Option<Result<T, Error>>
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().
Sourcepub fn is_open(&self) -> bool
pub fn is_open(&self) -> bool
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§
Auto Trait Implementations§
impl<T> Freeze for ImNativeFileDialog<T>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more