Large structure update
This commit is contained in:
+6
-22
@@ -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!";)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user