mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-02-21 18:49:04 +01:00
This commit is contained in:
parent
f3fcf663a8
commit
501782f8fe
18 changed files with 841 additions and 908 deletions
|
|
@ -1,5 +1,13 @@
|
|||
#![feature(type_changing_struct_update, trait_alias)]
|
||||
pub use ::{tengri_input, tengri_output, ratatui, crossterm, palette, better_panic};
|
||||
pub use ::{
|
||||
dizzle,
|
||||
tengri_input,
|
||||
tengri_output,
|
||||
ratatui,
|
||||
crossterm,
|
||||
palette,
|
||||
better_panic,
|
||||
};
|
||||
pub(crate) use ::{
|
||||
dizzle::*,
|
||||
tengri_input::*,
|
||||
|
|
@ -23,13 +31,23 @@ pub(crate) use ::{
|
|||
};
|
||||
mod tui_engine; pub use self::tui_engine::*;
|
||||
mod tui_content; pub use self::tui_content::*;
|
||||
#[macro_export] macro_rules! tui_main {
|
||||
($expr:expr) => {
|
||||
fn main () -> Usually<()> {
|
||||
let state = Arc::new(RwLock::new($expr));
|
||||
tengri_tui::Tui::new().unwrap().run(&state)?;
|
||||
Ok(())
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(test)] mod tui_test {
|
||||
use crate::*;
|
||||
#[test] fn test_tui_engine () -> Usually<()> {
|
||||
//use std::sync::{Arc, RwLock};
|
||||
struct TestComponent(String);
|
||||
impl Content<TuiOut> for TestComponent {
|
||||
fn content (&self) -> impl Draw<TuiOut> {
|
||||
impl HasContent<TuiOut> for TestComponent {
|
||||
fn content (&self) -> impl Content<TuiOut> {
|
||||
Some(self.0.as_str())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue