mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-24 01:46:31 +00:00
21 lines
391 B
Rust
21 lines
391 B
Rust
extern crate cursive;
|
|
|
|
use cursive::views::TextView;
|
|
use cursive::Cursive;
|
|
|
|
fn main() {
|
|
let mut siv = Cursive::default();
|
|
|
|
// We can quit by pressing `q`
|
|
siv.add_global_callback('q', Cursive::quit);
|
|
|
|
// Add a simple view
|
|
siv.add_layer(TextView::new(
|
|
"Hello World!\n\
|
|
Press q to quit the application.",
|
|
));
|
|
|
|
// Run the event loop
|
|
siv.run();
|
|
}
|