Add Terminal::{present_widget, present_async_widget}
This commit is contained in:
parent
ed14ea9023
commit
ac2546ba97
2 changed files with 37 additions and 9 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue