Skip to main content

gif/
gif.rs

1use {
2    cursive::{views::*, *},
3    cursive_image::*,
4};
5
6const FILE: &str = "assets/media/linux.gif";
7
8fn main() {
9    let mut cursive = default();
10
11    cursive.add_layer(Panel::new(ImageView::default().with_image(
12        // GIFs will always be RGBA
13        Image::new_stream_from_gif_file(FILE).expect("new_stream_from_gif_file"),
14    )));
15
16    cursive.add_global_callback('q', |cursive| cursive.quit());
17
18    cursive.run();
19}