cursive/examples/theme.rs

25 lines
642 B
Rust
Raw Normal View History

extern crate cursive;
use cursive::Cursive;
use cursive::views::{Dialog, TextView};
fn main() {
let mut siv = Cursive::default();
// You can load a theme from a file at runtime for fast development.
2018-03-22 18:04:10 +00:00
siv.load_theme_file("assets/style.toml")
.unwrap();
// Or you can directly load it from a string for easy deployment.
// siv.load_theme(include_str!("../assets/style.toml")).unwrap();
2017-10-12 23:38:55 +00:00
siv.add_layer(
Dialog::around(TextView::new(
"This application uses a \
custom theme!",
)).title("Themed dialog")
.button("Quit", |s| s.quit()),
);
siv.run();
}