diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2019-01-08 17:16:49 +0000 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2019-01-08 20:55:54 +0100 |
commit | 474d92046f17a98f8979e55edaf75ca867d85b86 (patch) | |
tree | f62af448dcdd0547a88954fb514fbb1eba735f43 /examples | |
parent | 72200eb89e91019777f84c881caf5d3cc9649fbd (diff) | |
download | dialog-rs-474d92046f17a98f8979e55edaf75ca867d85b86.tar.gz dialog-rs-474d92046f17a98f8979e55edaf75ca867d85b86.tar.bz2 |
Add the Password dialog box
Diffstat (limited to 'examples')
-rw-r--r-- | examples/password.rs | 15 |
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(()) +} |