mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-03 07:04:34 +00:00
Use Pin<&Self> for Property::get
This commit is contained in:
parent
0029921f1a
commit
2d22bac451
5 changed files with 108 additions and 74 deletions
|
@ -7,11 +7,13 @@ fn main() {
|
|||
|
||||
app.plus_clicked.set_handler(|context, ()| {
|
||||
let app = context.get_component::<Hello>().unwrap();
|
||||
app.counter.set(app.counter.get(context) + 1);
|
||||
let counter = Hello::field_offsets().counter.apply_pin(app);
|
||||
counter.set(counter.get(context) + 1);
|
||||
});
|
||||
app.minus_clicked.set_handler(|context, ()| {
|
||||
let app = context.get_component::<Hello>().unwrap();
|
||||
app.counter.set(app.counter.get(context) - 1);
|
||||
let counter = Hello::field_offsets().counter.apply_pin(app);
|
||||
counter.set(counter.get(context) - 1);
|
||||
});
|
||||
app.run();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue