mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
24 lines
626 B
Rust
24 lines
626 B
Rust
extern crate cursive;
|
|
|
|
use cursive::views::{CircularFocus, Dialog, TextView};
|
|
use cursive::Cursive;
|
|
|
|
fn main() {
|
|
// Creates the cursive root - required for every application.
|
|
let mut siv = Cursive::default();
|
|
|
|
// Creates a dialog with a single "Quit" button
|
|
siv.add_layer(
|
|
// Most views can be configured in a chainable way
|
|
CircularFocus::wrap_tab(
|
|
Dialog::around(TextView::new("Hello Dialog!"))
|
|
.title("Cursive")
|
|
.button("Foo", |s| ())
|
|
.button("Quit", |s| s.quit()),
|
|
),
|
|
);
|
|
|
|
// Starts the event loop.
|
|
siv.run();
|
|
}
|