-
You could say I'm "new" to Rust & Slint, I've started using it for around a weeks now. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I want a button to execute a rust command |
Beta Was this translation helpful? Give feedback.
-
What you are probably looking for is the clicked callback on the button. Here is an example of basic usage withing slint in the docs: https://slint.dev/releases/1.1.1/docs/slint/src/recipes/recipes. For doing something from the Rust code when a button is clicked you would want to handle the on_mybutton_clicked callback in the rust code.
You could see some more examples in my code [https://github.com/Vadoola/Tomotroid/blob/main/src/main.rs](here: https://github.com/Vadoola/Tomotroid/blob/main/src/main.rs) or look at the main_window.on_filter_image section of the Slint ImageFilter Demo |
Beta Was this translation helpful? Give feedback.
-
Thanks! |
Beta Was this translation helpful? Give feedback.
What you are probably looking for is the clicked callback on the button. Here is an example of basic usage withing slint in the docs: https://slint.dev/releases/1.1.1/docs/slint/src/recipes/recipes.
For doing something from the Rust code when a button is clicked you would want to handle the on_mybutton_clicked callback in the rust code.
You could see some more examples in my code [https://github.com/Vadoola/Tomotroid/blob/main/src/main.rs](here: https://github.com/Vadoola/Tomotroid/blob/main/src/main.rs)
or look at the ma…