cursive/examples/dialog.rs
2016-06-25 17:11:42 -07:00

18 lines
454 B
Rust

extern crate cursive;
use cursive::Cursive;
use cursive::view::{TextView, Dialog};
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::new(TextView::new("Hello Dialog!"))
.title("Cursive")
.button("Quit", |s| s.quit()));
// Starts the event loop.
siv.run();
}