From 0ccf03de3bc5c72ead1b30c1a41f4fbe628578ad Mon Sep 17 00:00:00 2001 From: Leo dev Date: Sat, 2 Aug 2025 06:02:54 -0500 Subject: [PATCH] Simple demos #15 --- src/demos/mod.rs | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/demos/mod.rs b/src/demos/mod.rs index b666c0d..869e8d0 100644 --- a/src/demos/mod.rs +++ b/src/demos/mod.rs @@ -1,7 +1,34 @@ use osui::prelude::*; pub fn app() -> Rsx { + let count = use_state(0); + + std::thread::spawn({ + let count = count.clone(); + move || loop { + **count.get() += 1; + std::thread::sleep(std::time::Duration::from_secs(1)); + } + }); + rsx! { - "Hello, World" + FlexRow { + FlexCol { + @Transform::new().padding(2, 2); + @Style { foreground: None, background: Background::RoundedOutline(0x00ff00) }; // TODO: Outline doesn't work + Div { + "This is text inside a div" + } + + // TODO: div with width full + } (2) + + FlexCol { + Div { + %count + "This will increment every second: {count}" + } + } (2) + } (0) } }