use cursive::align::HAlign;
use cursive::traits::*;
use cursive::views::{Dialog, DummyView, LinearLayout, TextView};
fn main() {
let mut siv = cursive::default();
let text = "This is a very simple example of linear layout. Two views \
are present, a short title above, and this text. The text \
has a fixed width, and the title is centered horizontally.";
siv.add_layer(
Dialog::around(
LinearLayout::vertical()
.child(TextView::new("Title").h_align(HAlign::Center))
.child(DummyView.fixed_height(1))
.child(TextView::new(text))
.child(TextView::new(text).scrollable())
.child(TextView::new(text).scrollable())
.child(TextView::new(text).scrollable())
.fixed_width(30),
)
.button("Quit", |s| s.quit())
.h_align(HAlign::Center),
);
siv.run();
}