2015-05-16 21:02:15 +00:00
|
|
|
extern crate cursive;
|
|
|
|
|
2016-09-29 05:45:27 +00:00
|
|
|
use cursive::Cursive;
|
|
|
|
use cursive::views::{Dialog, TextView};
|
2015-05-16 21:02:15 +00:00
|
|
|
|
|
|
|
fn main() {
|
2016-06-26 00:10:18 +00:00
|
|
|
// Creates the cursive root - required for every application.
|
2015-05-16 21:02:15 +00:00
|
|
|
let mut siv = Cursive::new();
|
|
|
|
|
|
|
|
// Creates a dialog with a single "Quit" button
|
2016-10-02 22:15:30 +00:00
|
|
|
siv.add_layer(Dialog::around(TextView::new("Hello Dialog!"))
|
2016-09-29 05:45:27 +00:00
|
|
|
.title("Cursive")
|
|
|
|
.button("Quit", |s| s.quit()));
|
2015-05-16 21:02:15 +00:00
|
|
|
|
2016-06-26 00:10:18 +00:00
|
|
|
// Starts the event loop.
|
2015-05-16 21:02:15 +00:00
|
|
|
siv.run();
|
|
|
|
}
|