-
New to Slint. Playing around a bit and tried to add a callback to a UI generated with slint_interpreter.
And a
How can I get e.g. a simple
executed every time when I click the button? How to implement |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
You're probably looking for You may have to call it before you call |
Beta Was this translation helpful? Give feedback.
-
Thank you, yes, that's probably what I missed to find. Somehow I though it should be in |
Beta Was this translation helpful? Give feedback.
-
Thanks again, it's working.
did throw some errors because it expects closure parameters and a return value. I am not a rust expert but with some fiddling I found this
to be fine and all errors and warnings vanished. |
Beta Was this translation helpful? Give feedback.
You're probably looking for
set_callback
. I think you can call it like so:instance.set_callback("button-clicked", || { println!("...") });
.You may have to call it before you call
run()
.