mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 22:54:36 +00:00
18 lines
524 B
Rust
18 lines
524 B
Rust
#![deny(unsafe_code)]
|
|
|
|
sixtyfps::include_modules!();
|
|
|
|
fn main() {
|
|
let app = Hello::new();
|
|
let app_weak = app.clone().as_weak();
|
|
app.as_ref().on_plus_clicked(move || {
|
|
let app = app_weak.upgrade().unwrap();
|
|
app.as_ref().set_counter(app.as_ref().get_counter() + 1);
|
|
});
|
|
let app_weak = app.clone().as_weak();
|
|
app.as_ref().on_minus_clicked(move || {
|
|
let app = app_weak.upgrade().unwrap();
|
|
app.as_ref().set_counter(app.as_ref().get_counter() - 1);
|
|
});
|
|
app.run();
|
|
}
|