summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorStephan Sokolow <http://www.ssokolow.com/ContactMe>2019-10-24 20:36:42 -0400
committerRobin Krahl <robin.krahl@ireas.org>2019-10-25 22:32:45 +0200
commita23de9787bccde4b6244312f04cb7cfc3b528db6 (patch)
tree06bee04d6b347ffec53493fcf8c9bbfc6c7eb93c /examples
parent10462c2c9f4ae2ffd3c32dd4628e0052067c15fa (diff)
downloaddialog-rs-a23de9787bccde4b6244312f04cb7cfc3b528db6.tar.gz
dialog-rs-a23de9787bccde4b6244312f04cb7cfc3b528db6.tar.bz2
Add a backend based on KDE's `kdialog`
Diffstat (limited to 'examples')
-rw-r--r--examples/backend-kdialog.rs18
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)
+}