pub struct MessageDialogBuilder<R: Runtime> { /* private fields */ }
Expand description
A builder for message dialogs.
Implementations§
Source§impl<R: Runtime> MessageDialogBuilder<R>
impl<R: Runtime> MessageDialogBuilder<R>
Sourcepub fn new(
dialog: Dialog<R>,
title: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn new( dialog: Dialog<R>, title: impl Into<String>, message: impl Into<String>, ) -> Self
Creates a new message dialog builder.
Sourcepub fn parent<W: HasWindowHandle + HasDisplayHandle>(self, parent: &W) -> Self
pub fn parent<W: HasWindowHandle + HasDisplayHandle>(self, parent: &W) -> Self
Set parent windows explicitly (optional)
Sets the dialog buttons.
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.
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
Returns true
if the user pressed the OK/Yes button,
Sourcepub fn show_with_result<F: FnOnce(MessageDialogResult) + Send + 'static>(
self,
f: F,
)
pub fn show_with_result<F: FnOnce(MessageDialogResult) + Send + 'static>( self, f: F, )
Shows a message dialog and returns the button that was pressed.
Returns a MessageDialogResult
enum that indicates which button was pressed.
Sourcepub fn blocking_show(self) -> bool
pub fn blocking_show(self) -> bool
Shows a message dialog.
Returns true
if the user pressed the OK/Yes button,
This is a blocking operation, and should NOT be used when running on the main thread context.
Sourcepub fn blocking_show_with_result(self) -> MessageDialogResult
pub fn blocking_show_with_result(self) -> MessageDialogResult
Shows a message dialog and returns the button that was pressed.
Returns a MessageDialogResult
enum that indicates which button was pressed.
This is a blocking operation, and should NOT be used when running on the main thread context.