Skip to main content

simple/
simple.rs

1use {
2    cursive::{views::*, *},
3    cursive_image::*,
4};
5
6const FILE: &str = "assets/media/linux.png";
7
8fn main() {
9    let mut cursive = default();
10
11    // By default the image view uses "fit" sizing
12    // This means that it will require the minimal character box that fits the image
13
14    cursive.add_layer(Panel::new(ImageView::default().with_image_file(FILE)));
15
16    cursive.add_global_callback('q', |cursive| cursive.quit());
17
18    cursive.run();
19}