slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.93k stars 567 forks source link

I want to use asynchronous methods in on_clicked #2876

Closed spades9 closed 1 year ago

spades9 commented 1 year ago
let window_weak_2 = main_window.as_weak();
main_window.global::<WatermarkGlobal>().on_download(move || {
    let _ = update_image(window_weak_2.clone());
});

I want to upload_ Image is an async method,I don't understand how to implement this here

ogoffart commented 1 year ago

Thanks for submitting an issue. This has been asked before in #747 There is some work in progress to solves this in https://github.com/slint-ui/slint/pull/2845

Closing as duplicated of #747