diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2019-01-11 03:41:30 +0100 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2019-01-11 03:44:38 +0100 |
commit | 4875863ceb3acfe6d2ab17c9f76df49adb9473a7 (patch) | |
tree | ea04e2da6251be762035d003238bc67bd2e25f93 | |
parent | 84bfea7add93a98f83ad958151cca718c33bc0a4 (diff) | |
download | dialog-rs-4875863ceb3acfe6d2ab17c9f76df49adb9473a7.tar.gz dialog-rs-4875863ceb3acfe6d2ab17c9f76df49adb9473a7.tar.bz2 |
Add usage example to readme
-rw-r--r-- | README.md | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 |