2015-05-09 19:18:25 +00:00
|
|
|
extern crate cursive;
|
|
|
|
|
2016-09-29 05:45:27 +00:00
|
|
|
use cursive::Cursive;
|
|
|
|
use cursive::views::TextView;
|
2015-05-09 19:18:25 +00:00
|
|
|
|
|
|
|
fn main() {
|
2018-04-01 23:39:03 +00:00
|
|
|
let mut siv = Cursive::default();
|
2015-05-09 19:18:25 +00:00
|
|
|
|
2016-08-02 07:32:16 +00:00
|
|
|
// We can quit by pressing `q`
|
|
|
|
siv.add_global_callback('q', Cursive::quit);
|
2015-05-09 19:18:25 +00:00
|
|
|
|
2018-01-16 02:55:27 +00:00
|
|
|
// Add a simple view
|
2017-10-12 23:38:55 +00:00
|
|
|
siv.add_layer(TextView::new(
|
|
|
|
"Hello World!\n\
|
|
|
|
Press q to quit the application.",
|
|
|
|
));
|
2015-05-15 23:06:48 +00:00
|
|
|
|
2018-01-16 02:55:27 +00:00
|
|
|
// Run the event loop
|
2015-05-09 19:18:25 +00:00
|
|
|
siv.run();
|
|
|
|
}
|