From 474d92046f17a98f8979e55edaf75ca867d85b86 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 8 Jan 2019 17:16:49 +0000 Subject: Add the Password dialog box --- examples/password.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 examples/password.rs (limited to 'examples') diff --git a/examples/password.rs b/examples/password.rs new file mode 100644 index 0000000..7504bdd --- /dev/null +++ b/examples/password.rs @@ -0,0 +1,15 @@ +// Copyright (C) 2019 Robin Krahl +// SPDX-License-Identifier: MIT + +use dialog::DialogBox; + +fn main() -> dialog::Result<()> { + let password = dialog::Password::new("Please enter a new password") + .title("Password") + .show()?; + match password { + Some(password) => println!("Your new password is: {}", password), + None => println!("You do not want to have a password."), + }; + Ok(()) +} -- cgit v1.2.3