added positioning in rsx

This commit is contained in:
2025-01-18 15:04:09 +01:00
parent bde4438663
commit 9ecf8de501
6 changed files with 196 additions and 80 deletions
+7 -11
View File
@@ -3,20 +3,16 @@ use osui::prelude::*;
fn main() -> osui::Result<()> {
let mut con = console::init()?;
let (ui, _count) = app();
con.run(ui).unwrap();
con.run(app())?;
console::end()
}
pub fn app() -> (Element, state::State<i32>) {
let count = use_state(0);
let count1 = count.copy_state();
pub fn app() -> Element {
rsx! {
"X" (x-Center)
"Y" (y-Center)
(
rsx! {
"{count}"
},
count1,
)
"Hello, World" (x-Center, y-Center)
}
}