Update readme example

This commit is contained in:
Alexandre Bury 2015-05-19 11:01:16 -07:00
parent ca5c485847
commit 163f019908

View File

@ -8,13 +8,14 @@ It is designed to be safe and easy to use:
```rust
extern crate cursive;
use cursive::{Cursive,Dialog};
use cursive::{Cursive,Dialog,TextView};
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()));
siv.add_layer(Dialog::new(TextView::new("Hello world!"))
.button("Quit", |s, _| s.quit()));
// Starts the event loop.
siv.run();