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() { // cook pancake and init colors let pancake = FryingPan::default() .hide_cursor(true) .no_delay(true) .color(true) .build() .unwrap(); init_pair(BLUE_WHITE, COLOR_BLUE, COLOR_WHITE); // make panel, position v v size let mut panel = Panel::new(Point::from(1, 1), 10, 30); panel.draw_box(); // printing does not move the cursor panel.mv_print(Point::from(1, 0), "╴pancakes╶"); panel.mv_print(Point::from(1, 1), "hello"); // the cursor will be within bounds, unwrap is fine 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(); }