Struct rfd::MessageDialog
source · pub struct MessageDialog { /* private fields */ }
Expand description
Synchronous Message Dialog. Supported platforms:
- Windows
- macOS
- Linux (GTK only)
- WASM
Implementations§
source§impl MessageDialog
impl MessageDialog
pub fn new() -> Self
sourcepub fn set_level(self, level: MessageLevel) -> Self
pub fn set_level(self, level: MessageLevel) -> Self
Set level of a dialog
Depending on the system it can result in level specific icon to show up, the will inform user it message is a error, warning or just information.
sourcepub fn set_description(self, text: impl Into<String>) -> Self
pub fn set_description(self, text: impl Into<String>) -> Self
Set description of a dialog
Description is a content of a dialog
Set the set of button that will be displayed on the dialog
Ok
dialog is a singleOk
buttonOkCancel
dialog, will display 2 buttons: ok and cancel.YesNo
dialog, will display 2 buttons: yes and no.YesNoCancel
dialog, will display 3 buttons: yes, no, and cancel.
sourcepub fn set_parent<W: HasRawWindowHandle>(self, parent: &W) -> Self
pub fn set_parent<W: HasRawWindowHandle>(self, parent: &W) -> Self
Set parent windows explicitly (optional)
Suported in: macos
and windows
sourcepub fn show(self) -> MessageDialogResult
pub fn show(self) -> MessageDialogResult
Shows a message dialog and returns the button that was pressed.
Trait Implementations§
source§impl Clone for MessageDialog
impl Clone for MessageDialog
source§fn clone(&self) -> MessageDialog
fn clone(&self) -> MessageDialog
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MessageDialog
impl Debug for MessageDialog
source§impl Default for MessageDialog
impl Default for MessageDialog
source§fn default() -> MessageDialog
fn default() -> MessageDialog
Returns the “default value” for a type. Read more
impl Send for MessageDialog
Auto Trait Implementations§
impl RefUnwindSafe for MessageDialog
impl !Sync for MessageDialog
impl Unpin for MessageDialog
impl UnwindSafe for MessageDialog
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
Mutably borrows from an owned value. Read more