cursive/examples/dialog.rs
Alexandre Bury 8fa704bcfa Rename Dialog::new -> Dialog::around
And `Dialog::empty` -> `Dialog::new`
2016-10-02 15:15:30 -07:00

18 lines
430 B
Rust

extern crate cursive;
use cursive::Cursive;
use cursive::views::{Dialog, TextView};
fn main() {
// Creates the cursive root - required for every application.
let mut siv = Cursive::new();
// Creates a dialog with a single "Quit" button
siv.add_layer(Dialog::around(TextView::new("Hello Dialog!"))
.title("Cursive")
.button("Quit", |s| s.quit()));
// Starts the event loop.
siv.run();
}