diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2019-12-10 20:09:59 +0100 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2019-12-10 20:09:59 +0100 |
commit | aa8148b958daac4b35173a1d28806b2fdc8609bd (patch) | |
tree | d3c438f91a911f8e4bd0fb96dc833edaac4f21e6 /examples/backend-kdialog.rs | |
parent | 10462c2c9f4ae2ffd3c32dd4628e0052067c15fa (diff) | |
parent | 202c49a327b7a3dc3bfa199da2ac7484ee105f65 (diff) | |
download | dialog-rs-master.tar.gz dialog-rs-master.tar.bz2 |
Diffstat (limited to 'examples/backend-kdialog.rs')
-rw-r--r-- | examples/backend-kdialog.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/backend-kdialog.rs b/examples/backend-kdialog.rs new file mode 100644 index 0000000..5c3fb46 --- /dev/null +++ b/examples/backend-kdialog.rs @@ -0,0 +1,18 @@ +// Copyright (C) 2019 Robin Krahl <robin.krahl@ireas.org> +// SPDX-License-Identifier: MIT + +use dialog::backends; +use dialog::DialogBox; + +fn main() -> dialog::Result<()> { + let mut backend = backends::KDialog::new(); + + dialog::Message::new("This is a message.") + .title("And this is a title:") + .show_with(&backend)?; + + backend.set_icon("error"); + dialog::Message::new("This is an error message.") + .title("Error") + .show_with(&backend) +} |