This commit is contained in:
2025-07-29 20:54:12 +02:00
parent 71660418a1
commit 5ca7221afa
3 changed files with 74 additions and 27 deletions
+13 -27
View File
@@ -10,33 +10,19 @@ fn main() -> std::io::Result<()> {
fn app() -> Rsx {
rsx! {
@Transform::center();
FlexCol {
test => (1)
test => (3)
} (0x0000ff, 4)
}
}
fn test(inc: i32) -> Rsx {
let count = use_state(0);
std::thread::spawn({
let count = count.clone();
move || loop {
std::thread::sleep(std::time::Duration::from_millis(50));
**count.get() += inc;
}
});
rsx! {
@Transform::new().dimensions(40, 3);
@transform! {
width: Full,
height: Full,
};
Div {
@transform! { x: Center, y: Center, width: 5 };
Div {
%count
"{count}"
} (0x00ff00)
} (0xff0000)
@transform! {
width: Full,
height: Full,
};
RoundedOutline {}
@Transform::center();
"Welcome To OSUI!"
} (0x000000)
}
}