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