aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-01-11 03:41:30 +0100
committerRobin Krahl <robin.krahl@ireas.org>2019-01-11 03:44:38 +0100
commit4875863ceb3acfe6d2ab17c9f76df49adb9473a7 (patch)
treeea04e2da6251be762035d003238bc67bd2e25f93
parent84bfea7add93a98f83ad958151cca718c33bc0a4 (diff)
downloaddialog-rs-4875863ceb3acfe6d2ab17c9f76df49adb9473a7.tar.gz
dialog-rs-4875863ceb3acfe6d2ab17c9f76df49adb9473a7.tar.bz2
Add usage example to readme
-rw-r--r--README.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/README.md b/README.md
index 3af0e10..d2439b0 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,27 @@ A Rust library for displaying dialog boxes using various backends.
[Documentation][]
+Currently `dialog-rs` supports input, message, password and question dialogs.
+It can use the `dialog` or `zenity` tools to display the dialog boxes. If none
+of these tools is available, the dialogs are printed to the standard output.
+
+## Example
+
+```rust
+use dialog::DialogBox;
+
+let choice = dialog::Question::new("Would you like to install Rust?")
+ .title("Rust Installation")
+ .show()
+ .expect("Could not display dialog box");
+if choice == dialog::Choice::Yes {
+ dialog::Message::new("You made the right choice!")
+ .title("Rust Installation")
+ .show()
+ .expect("Could not display dialog box");
+}
+```
+
## Contact
For bug reports, patches, feature requests or other messages, please send a