-
I have read many threads on the topic of setting an Image The following does not work as I am pretty sure I want to have the images loaded from my Rust code using ``slint::Image::load_from_path`. However, I am not clear on the interaction between the .slint file and my main.rs. I have fleshed out a function My attempt at using a callback did not work because on the .slint side I don't see the hook to execute the call back. Maybe some kind of "on component load" but have not found anything. I can provide the code for this attempt. If someone can provide an example of how to do this it would be great. main.slint:
function-button.slint:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Does this work if you do it like this? making the property an image instead of a string? Main.slint
function-button.slint:
|
Beta Was this translation helpful? Give feedback.
-
It does work. Thanks! When I first saw your approach I didn't see how it was going to help but it did. I am still not sure why doing the `@image-url()' in the higher level .slint changes things but that won't stop me from doing it :) |
Beta Was this translation helpful? Give feedback.
Does this work if you do it like this? making the property an image instead of a string?
Main.slint