diff --git a/tek/examples/edn.rs b/tek/examples/edn.rs index e2cf0066..edca5431 100644 --- a/tek/examples/edn.rs +++ b/tek/examples/edn.rs @@ -14,10 +14,11 @@ const EDN: &'static [&'static str] = &[ include_str!("edn08.edn"), include_str!("edn09.edn"), include_str!("edn10.edn"), + include_str!("edn11.edn"), ]; fn main () -> Usually<()> { - let state = Arc::new(RwLock::new(Example(4, Measure::new()))); + let state = Arc::new(RwLock::new(Example(10, Measure::new()))); Tui::new().unwrap().run(&state)?; Ok(()) } @@ -44,10 +45,13 @@ impl EdnViewData for &Example { impl Content for Example { fn content (&self) -> impl Render { - let title = Tui::bg(Color::Rgb(60,10,10), Push::y(1, Align::n(format!("Example {}/{} in {:?}", self.0 + 1, EDN.len(), &self.1.wh())))); - let code = Tui::bg(Color::Rgb(10,60,10), Push::y(2, Align::n(format!("{}", EDN[self.0])))); - let content = Tui::bg(Color::Rgb(10,10,60), EdnView::from_source(self, EDN[self.0])); - self.1.of(Bsp::s(title, Bsp::n(code, content))) + let title = Tui::bg(Color::Rgb(60,10,10), + Push::y(1, Align::n(format!("Example {}/{} in {:?}", self.0 + 1, EDN.len(), &self.1.wh())))); + let code = Tui::bg(Color::Rgb(10,60,10), + Push::y(2, Align::n(format!("{}", EDN[self.0])))); + let content = Tui::bg(Color::Rgb(10,10,60), + EdnView::from_source(self, EDN[self.0])); + self.1.of(Bsp::s(title, Bsp::n(""/*code*/, content))) } } diff --git a/tek/examples/edn11.edn b/tek/examples/edn11.edn new file mode 100644 index 00000000..97ed0638 --- /dev/null +++ b/tek/examples/edn11.edn @@ -0,0 +1,17 @@ +(bsp/s + (bsp/e + (align/nw (fixed/xy 5 3 :hello)) + (bsp/e + (align/n (fixed/xy 5 3 :hello)) + (align/ne (fixed/xy 5 3 :hello)))) + (bsp/s + (bsp/e + (align/w (fixed/xy 5 3 :hello)) + (bsp/e + (align/c (fixed/xy 5 3 :hello)) + (align/e (fixed/xy 5 3 :hello)))) + (bsp/e + (align/sw (fixed/xy 5 3 :hello)) + (bsp/e + (align/s (fixed/xy 5 3 :hello)) + (align/se (fixed/xy 5 3 :hello))))))