Large structure update

This commit is contained in:
2024-10-30 14:14:00 +01:00
parent 943bcf874a
commit 87ae71072e
6 changed files with 161 additions and 629 deletions
+6 -22
View File
@@ -1,29 +1,13 @@
use osui::{oml, ui::*, App, Component};
use osui::{oml, ui::*, App};
fn main() {
let mut app = App::new();
app.set_component(app_elem());
app.run();
let mut app_screen = App::new();
app_screen.set_component(app());
app_screen.run();
}
fn onclick(c: &mut Component) {
if c.clicked {
c.expr = "Clicked!".to_string();
} else {
c.expr = "click me".to_string()
}
}
fn app_elem() -> Component {
fn app() -> Box<Text> {
oml!(
tab {
div {
text("Hello, World!";)
}
div {
button("click me"; toggle = false, on_click = onclick)
}
}
text("Hello, World!";)
)
}