pub struct DIALOG;Expand description
Dialog service.
The non-custom dialog methods can be configured to open as native dialogs instead of the custom overlay dialogs.
§Panics
All dialog methods panic is not called inside a window.
Implementations§
Source§impl DIALOG
impl DIALOG
Sourcepub fn info(
&self,
title: impl IntoVar<Txt>,
msg: impl IntoVar<Txt>,
) -> ResponseVar<()>
pub fn info( &self, title: impl IntoVar<Txt>, msg: impl IntoVar<Txt>, ) -> ResponseVar<()>
Show an info dialog with “Ok” button.
Sourcepub fn warn(
&self,
title: impl IntoVar<Txt>,
msg: impl IntoVar<Txt>,
) -> ResponseVar<()>
pub fn warn( &self, title: impl IntoVar<Txt>, msg: impl IntoVar<Txt>, ) -> ResponseVar<()>
Show a warning dialog with “Ok” button.
Sourcepub fn error(
&self,
title: impl IntoVar<Txt>,
msg: impl IntoVar<Txt>,
) -> ResponseVar<()>
pub fn error( &self, title: impl IntoVar<Txt>, msg: impl IntoVar<Txt>, ) -> ResponseVar<()>
Show an error dialog with “Ok” button.
Sourcepub fn ask(
&self,
title: impl IntoVar<Txt>,
question: impl IntoVar<Txt>,
) -> ResponseVar<bool>
pub fn ask( &self, title: impl IntoVar<Txt>, question: impl IntoVar<Txt>, ) -> ResponseVar<bool>
Shows a question dialog with “No” and “Yes” buttons. Returns true for “Yes”.
Sourcepub fn confirm(
&self,
title: impl IntoVar<Txt>,
question: impl IntoVar<Txt>,
) -> ResponseVar<bool>
pub fn confirm( &self, title: impl IntoVar<Txt>, question: impl IntoVar<Txt>, ) -> ResponseVar<bool>
Shows a question dialog with “Cancel” and “Ok” buttons. Returns true for “Ok”.
Sourcepub fn open_file(
&self,
title: impl IntoVar<Txt>,
starting_dir: impl Into<PathBuf>,
starting_name: impl IntoVar<Txt>,
filters: impl Into<FileDialogFilters>,
) -> ResponseVar<FileDialogResponse>
pub fn open_file( &self, title: impl IntoVar<Txt>, starting_dir: impl Into<PathBuf>, starting_name: impl IntoVar<Txt>, filters: impl Into<FileDialogFilters>, ) -> ResponseVar<FileDialogResponse>
Shows a native file picker dialog configured to select one existing file.
Sourcepub fn open_files(
&self,
title: impl IntoVar<Txt>,
starting_dir: impl Into<PathBuf>,
starting_name: impl IntoVar<Txt>,
filters: impl Into<FileDialogFilters>,
) -> ResponseVar<FileDialogResponse>
pub fn open_files( &self, title: impl IntoVar<Txt>, starting_dir: impl Into<PathBuf>, starting_name: impl IntoVar<Txt>, filters: impl Into<FileDialogFilters>, ) -> ResponseVar<FileDialogResponse>
Shows a native file picker dialog configured to select one or more existing files.
Sourcepub fn save_file(
&self,
title: impl IntoVar<Txt>,
starting_dir: impl Into<PathBuf>,
starting_name: impl IntoVar<Txt>,
filters: impl Into<FileDialogFilters>,
) -> ResponseVar<FileDialogResponse>
pub fn save_file( &self, title: impl IntoVar<Txt>, starting_dir: impl Into<PathBuf>, starting_name: impl IntoVar<Txt>, filters: impl Into<FileDialogFilters>, ) -> ResponseVar<FileDialogResponse>
Shows a native file picker dialog configured to select one file path that does not exist yet.
Sourcepub fn select_folder(
&self,
title: impl IntoVar<Txt>,
starting_dir: impl Into<PathBuf>,
starting_name: impl IntoVar<Txt>,
) -> ResponseVar<FileDialogResponse>
pub fn select_folder( &self, title: impl IntoVar<Txt>, starting_dir: impl Into<PathBuf>, starting_name: impl IntoVar<Txt>, ) -> ResponseVar<FileDialogResponse>
Shows a native file picker dialog configured to select one existing directory.
Sourcepub fn select_folders(
&self,
title: impl IntoVar<Txt>,
starting_dir: impl Into<PathBuf>,
starting_name: impl IntoVar<Txt>,
) -> ResponseVar<FileDialogResponse>
pub fn select_folders( &self, title: impl IntoVar<Txt>, starting_dir: impl Into<PathBuf>, starting_name: impl IntoVar<Txt>, ) -> ResponseVar<FileDialogResponse>
Shows a native file picker dialog configured to select one or more existing directories.
Sourcepub fn custom(&self, dialog: impl IntoUiNode) -> ResponseVar<Response>
pub fn custom(&self, dialog: impl IntoUiNode) -> ResponseVar<Response>
Open the custom dialog.
Returns the selected response or close if the dialog is closed without response.
Source§impl DIALOG
impl DIALOG
Sourcepub fn native_dialogs(&self) -> Var<DialogKind>
pub fn native_dialogs(&self) -> Var<DialogKind>
Variable that defines what native dialogs are used when the dialog methods are called in window contexts.
The native_dialogs context property can also be used to override the config just for some widgets.
Note that some dialogs only have the native implementation as of this release.
Source§impl DIALOG
impl DIALOG
Sourcepub fn respond_default(&self)
pub fn respond_default(&self)
Try to close the contextual dialog without directly setting a response.
If the dialog has no default_response the
on_dialog_close_canceled event notifies instead of closing.
Auto Trait Implementations§
impl Freeze for DIALOG
impl RefUnwindSafe for DIALOG
impl Send for DIALOG
impl Sync for DIALOG
impl Unpin for DIALOG
impl UnwindSafe for DIALOG
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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