pub struct ZenityDialog<T = Info>where
T: ZenityApplication,{
pub application: T,
pub title: Option<String>,
pub icon: Option<Icon>,
pub width: Option<usize>,
pub height: Option<usize>,
pub timeout: Option<Duration>,
pub modal_hint: Option<String>,
/* private fields */
}
Expand description
The configuration for a Zenity dialog.
Fields§
§application: T
The type of dialog to display
title: Option<String>
The title displayed at the top of the dialog
icon: Option<Icon>
Override for default icon
width: Option<usize>
Override default width of dialog
height: Option<usize>
Override default height of dialog
timeout: Option<Duration>
Duration after which the dialog automatically closes
modal_hint: Option<String>
Provide extra hint text to the user.
Implementations§
Source§impl<T> ZenityDialog<T>where
T: ZenityApplication + Default,
impl<T> ZenityDialog<T>where
T: ZenityApplication + Default,
Sourcepub fn new(application: T) -> Self
pub fn new(application: T) -> Self
Construct a new Zenity instance. It expects an [Application], which determines which kind of dialog will be displayed.
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Provide a custom title for the dialog.
Sourcepub fn with_width(self, width: usize) -> Self
pub fn with_width(self, width: usize) -> Self
Set a specific width for the dialog.
Sourcepub fn with_height(self, height: usize) -> Self
pub fn with_height(self, height: usize) -> Self
Set a specific height for the dialog.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Make the dialog close automatically after the duration has passed.
Render an extra button with the provided text as a label.
Sourcepub fn with_modal_hint(self, modal_hint: impl Into<String>) -> Self
pub fn with_modal_hint(self, modal_hint: impl Into<String>) -> Self
Render a hint displaying the provided text.
Sourcepub fn with_additional_arg(self, arg: impl Into<Arg>) -> Self
pub fn with_additional_arg(self, arg: impl Into<Arg>) -> Self
Attach an additional custom argument. Used to handle arguments that aren’t currently statically supported. Use at your own risk. Note that this function will automatically prepend – to the argument so there is no need to provide it. However, if you do provide it, it will still work.
Sourcepub fn with_additional_args(self, args: Vec<Arg>) -> Self
pub fn with_additional_args(self, args: Vec<Arg>) -> Self
Like with_additional_arg
, but takes a Vec
Sourcepub fn show(self) -> Result<ZenityOutput<T::Return>>
pub fn show(self) -> Result<ZenityOutput<T::Return>>
Render the dialog and wait for user response.
Trait Implementations§
Source§impl<T> Clone for ZenityDialog<T>where
T: ZenityApplication + Clone,
impl<T> Clone for ZenityDialog<T>where
T: ZenityApplication + Clone,
Source§fn clone(&self) -> ZenityDialog<T>
fn clone(&self) -> ZenityDialog<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more