mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-09-18 05:16:44 +02:00
This commit is contained in:
parent
39d3dacf1f
commit
cf67185ffd
2 changed files with 12 additions and 10 deletions
14
src/term.rs
14
src/term.rs
|
|
@ -145,16 +145,14 @@ impl Tui {
|
|||
panic(info);
|
||||
}));
|
||||
}
|
||||
pub fn run_main <T> (state: Arc<RwLock<T>>) -> Usually<()> where
|
||||
pub fn run_main <T> (exit: Exit, state: Arc<RwLock<T>>) -> Usually<()> where
|
||||
T: View<Tui> + Apply<TuiEvent, Usually<()>> + Send + Sync + 'static
|
||||
{
|
||||
Exit::run(|exit|{
|
||||
let scan = Duration::from_millis(100);
|
||||
let frame = Duration::from_millis(10);
|
||||
let (_input, output) = Tui::io(exit.as_ref(), &state, scan, frame, std::io::stdout())?;
|
||||
let _ = output.join();
|
||||
Tui::teardown(&mut stdout())
|
||||
})
|
||||
let scan = Duration::from_millis(100);
|
||||
let frame = Duration::from_millis(10);
|
||||
let (_input, output) = Tui::io(exit.as_ref(), &state, scan, frame, std::io::stdout())?;
|
||||
let _ = output.join();
|
||||
Tui::teardown(&mut stdout())
|
||||
}
|
||||
/// Spawn the TUI input and output threadsl.
|
||||
pub fn io <
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue