2016-09-29 05:45:27 +00:00
|
|
|
use cursive::views::{Dialog, TextView};
|
2015-06-06 01:08:05 +00:00
|
|
|
|
|
|
|
fn main() {
|
2020-04-15 19:20:50 +00:00
|
|
|
let mut siv = cursive::default();
|
2016-07-24 23:53:12 +00:00
|
|
|
|
2020-05-08 18:44:18 +00:00
|
|
|
// You can load a theme from a file at runtime for fast development.
|
|
|
|
siv.load_theme_file("assets/style.toml").unwrap();
|
2015-06-06 01:08:05 +00:00
|
|
|
|
2020-05-08 18:44:18 +00:00
|
|
|
// Or you can directly load it from a string for easy deployment.
|
2020-12-01 20:23:26 +00:00
|
|
|
siv.load_toml(include_str!("../../assets/style.toml"))
|
|
|
|
.unwrap();
|
2019-09-09 21:45:07 +00:00
|
|
|
|
2020-05-08 18:44:18 +00:00
|
|
|
siv.add_layer(
|
|
|
|
Dialog::around(TextView::new(
|
|
|
|
"This application uses a \
|
|
|
|
custom theme!",
|
|
|
|
))
|
|
|
|
.title("Themed dialog")
|
|
|
|
.button("Quit", |s| s.quit()),
|
|
|
|
);
|
2015-06-06 01:08:05 +00:00
|
|
|
|
|
|
|
siv.run();
|
|
|
|
}
|