Add Terminal::{present_widget, present_async_widget}

This commit is contained in:
Joscha 2023-02-17 14:00:28 +01:00
parent ed14ea9023
commit ac2546ba97
2 changed files with 37 additions and 9 deletions

View file

@ -22,14 +22,7 @@ fn widget() -> impl Widget<io::Error> {
}
fn render_frame(term: &mut Terminal) {
// Must be called before rendering, otherwise the terminal has out-of-date
// size information and will present garbage.
term.autoresize().unwrap();
widget().draw(term.frame()).unwrap();
while term.present().unwrap() {
term.autoresize().unwrap();
widget().draw(term.frame()).unwrap();
}
while term.present_widget(widget()).unwrap() {}
}
fn main() {