From f0f659944c6d89a6205fd98a2434ed61c0e7313b Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 8 Jan 2019 18:10:40 +0000 Subject: Implement zenity backend --- examples/backend-zenity.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 examples/backend-zenity.rs (limited to 'examples') diff --git a/examples/backend-zenity.rs b/examples/backend-zenity.rs new file mode 100644 index 0000000..67f3d1c --- /dev/null +++ b/examples/backend-zenity.rs @@ -0,0 +1,25 @@ +// Copyright (C) 2019 Robin Krahl +// SPDX-License-Identifier: MIT + +use dialog::backends; +use dialog::DialogBox; + +fn main() -> dialog::Result<()> { + let mut backend = backends::Zenity::new(); + + dialog::Message::new("This is a message.") + .title("And this is a title:") + .show_with(&backend)?; + + backend.set_width(500); + backend.set_height(200); + dialog::Message::new("This is a message with a fixed size.") + .title("And this is a title:") + .show_with(&backend)?; + + let mut backend = backends::Zenity::new(); + backend.set_timeout(5); + dialog::Message::new("This box should disappear after five seconds.") + .title("And this is a title:") + .show_with(&backend) +} -- cgit v1.2.3