From a23de9787bccde4b6244312f04cb7cfc3b528db6 Mon Sep 17 00:00:00 2001 From: Stephan Sokolow Date: Thu, 24 Oct 2019 20:36:42 -0400 Subject: Add a backend based on KDE's `kdialog` --- examples/backend-kdialog.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 examples/backend-kdialog.rs (limited to 'examples/backend-kdialog.rs') 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 +// 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) +} -- cgit v1.2.1