use fryingpan::{FryingPan, Input, Panel, Point, A_ITALIC, init_pair, COLOR_BLUE, color_pair, COLOR_WHITE};
use std::{thread::sleep, time::Duration};
const BLUE_WHITE: i16 = 1;
const SLEEP_TIME: Duration = Duration::from_millis(50);
fn main() {
let pancake = FryingPan::default()
.hide_cursor(true)
.no_delay(true)
.color(true)
.build()
.unwrap();
init_pair(BLUE_WHITE, COLOR_BLUE, COLOR_WHITE);
let mut panel = Panel::new(Point::from(1, 1), 10, 30);
panel.draw_box();
panel.mv_print(Point::from(1, 0), "â•´pancakesâ•¶");
panel.mv_print(Point::from(1, 1), "hello");
panel.attr_on(A_ITALIC).unwrap();
panel.attr_on(color_pair(BLUE_WHITE)).unwrap();
loop {
if let Some(Input::Character('q')) = pancake.get_char() {
break;
}
pancake.erase();
pancake.render_panel(&panel);
pancake.refresh();
sleep(SLEEP_TIME);
}
pancake.quit();
}