Struct tauri::api::dialog::MessageDialogBuilder
source · pub struct MessageDialogBuilder(_);
Available on
desktop
and crate feature dialog
only.Expand description
A builder for message dialogs.
Implementations§
source§impl MessageDialogBuilder
impl MessageDialogBuilder
sourcepub fn new(title: impl AsRef<str>, message: impl AsRef<str>) -> Self
pub fn new(title: impl AsRef<str>, message: impl AsRef<str>) -> Self
Creates a new message dialog builder.
sourcepub fn parent<W: HasRawWindowHandle>(self, parent: &W) -> Self
pub fn parent<W: HasRawWindowHandle>(self, parent: &W) -> Self
Set the set of button that will be displayed on the dialog.
sourcepub fn kind(self, kind: MessageDialogKind) -> Self
pub fn kind(self, kind: MessageDialogKind) -> Self
Set type of a dialog.
Depending on the system it can result in type specific icon to show up, the will inform user it message is a error, warning or just information.
source§impl MessageDialogBuilder
impl MessageDialogBuilder
sourcepub fn show<F: FnOnce(bool) + Send + 'static>(self, f: F)
pub fn show<F: FnOnce(bool) + Send + 'static>(self, f: F)
Shows a message dialog:
- In
Ok
dialog, it will call the closure withtrue
whenOK
was pressed - In
OkCancel
dialog, it will call the closure withtrue
whenOK
was pressed - In
YesNo
dialog, it will call the closure withtrue
whenYes
was pressed