summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/password.rs15
1 files changed, 15 insertions, 0 deletions
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 <robin.krahl@ireas.org>
+// 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(())
+}