some fine tuning
This commit is contained in:
+2
-25
@@ -1,29 +1,6 @@
|
||||
use osui::prelude::*;
|
||||
|
||||
pub struct App {}
|
||||
use osui::examples;
|
||||
|
||||
fn main() {
|
||||
while osui::run(&mut app()) {}
|
||||
}
|
||||
|
||||
fn app() -> Element {
|
||||
rsx! { styling: Some(styles()),
|
||||
button { class: "btn", on_click: Handler::new(|_, _, document| {
|
||||
if let Some(txt) = document.get_element_by_id::<Text>("txt") {
|
||||
txt.children.set_text("edited");
|
||||
}
|
||||
}), "Hello, World!" }
|
||||
text { id: "txt", y: 2, "Some text!" }
|
||||
}
|
||||
}
|
||||
|
||||
fn styles() -> Css {
|
||||
css! {
|
||||
.btn: clicked {
|
||||
color: Blue
|
||||
}
|
||||
.btn: hover {
|
||||
color: Red
|
||||
}
|
||||
}
|
||||
while osui::run(&mut examples::event_logger()) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user