pub struct KDialog { /* private fields */ }
Expand description
The kdialog
backend.
This backend uses the external kdialog
program to display KDE dialog boxes.
Implementations§
Source§impl KDialog
impl KDialog
Sourcepub fn new() -> KDialog
pub fn new() -> KDialog
Creates a new KDialog
instance without configuration.
Examples found in repository?
examples/backend-kdialog.rs (line 8)
7fn main() -> dialog::Result<()> {
8 let mut backend = backends::KDialog::new();
9
10 dialog::Message::new("This is a message.")
11 .title("And this is a title:")
12 .show_with(&backend)?;
13
14 backend.set_icon("error");
15 dialog::Message::new("This is an error message.")
16 .title("Error")
17 .show_with(&backend)
18}
Sourcepub fn set_icon(&mut self, icon: impl Into<String>)
pub fn set_icon(&mut self, icon: impl Into<String>)
Sets the icon in the dialog box’s titlebar and taskbar button.
The icon can be either a name from the user’s configured icon theme, such as error
or
info
or the path to an image to use.
The default image depends on the dialog type.
Examples found in repository?
examples/backend-kdialog.rs (line 14)
7fn main() -> dialog::Result<()> {
8 let mut backend = backends::KDialog::new();
9
10 dialog::Message::new("This is a message.")
11 .title("And this is a title:")
12 .show_with(&backend)?;
13
14 backend.set_icon("error");
15 dialog::Message::new("This is an error message.")
16 .title("Error")
17 .show_with(&backend)
18}
Trait Implementations§
Source§impl Backend for KDialog
impl Backend for KDialog
Source§fn show_input(&self, input: &Input) -> Result<Option<String>>
fn show_input(&self, input: &Input) -> Result<Option<String>>
Shows the given input dialog and returns the input.
Source§fn show_password(&self, password: &Password) -> Result<Option<String>>
fn show_password(&self, password: &Password) -> Result<Option<String>>
Shows the given password dialog and returns the password.
Source§fn show_question(&self, question: &Question) -> Result<Choice>
fn show_question(&self, question: &Question) -> Result<Choice>
Shows the given question dialog and returns the choice.
Source§fn show_file_selection(
&self,
file_selection: &FileSelection,
) -> Result<Option<String>>
fn show_file_selection( &self, file_selection: &FileSelection, ) -> Result<Option<String>>
Shows the given file selection dialog and returns the file name.
Auto Trait Implementations§
impl Freeze for KDialog
impl RefUnwindSafe for KDialog
impl Send for KDialog
impl Sync for KDialog
impl Unpin for KDialog
impl UnwindSafe for KDialog
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