From 7dbeedcb4909c7c3d6f7ecc29a7e5a5d50d13564 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Sat, 9 May 2015 12:28:21 -0700 Subject: [PATCH] Add readme with basic example --- Readme.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Readme.md diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..b53cb8a --- /dev/null +++ b/Readme.md @@ -0,0 +1,22 @@ +Cursive +======= + +Cursive is a ncurses-based TUI (Text User Interface) library for rust. It is based on jeaye's [ncurses-rs](https://github.com/jeaye/ncurses-rs). + +It is designed to be safe, and easy to use: + +```rust +extern crate cursive; + +use cursive::{Cursive,Dialog}; + +fn main() { + let mut siv = Cursive::new(); + + // Create a popup window with a "Ok" button that quits the application + siv.add_layer(Dialog::new("Hello world!").button("Ok", |s| s.quit())); + + // Starts the event loop. + siv.run(); +} +```