Replies: 2 comments
-
I just tried again to build the example and it does work. |
Beta Was this translation helpful? Give feedback.
-
hmm yes you are right - I've tried it on the rust slint template project and it worked. I think I'm trying to use it in a way that is not supported. I wanted to avoid passing callbacks and properties down thru a hierarchy of components - and I wanted to place an export global ComponentNameProps {} in each of my component slint files and then access the callbacks and properties from Rust using the main.global::().on_xxx where ever I needed instead of having all the properties and callbacks on the main. I've had some success by putting the export global ComponentNameProps in another file props.slint and then where I need to use it I've had to import { ComponentNameProps as ComponentNamePropsEx } from "props.slint" and then export { ComponentNamePropsEx} and then access it in Rust as main.global::().on_xxx But it's a bit fiddly having to import and then export it again. But if I don't it doesn't seem to work. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I followed the example in the docs e.g:
I put the export global in my main.slint file above the Main component (it says in the docs I need to put the global export in the same file as the entry component which I've done)
then in the Rust code:
However the Rust code doesn't compile because it doesn't find the Logic in the global scope. When I look inside the slint_generatedMain class in target I don't see anything called Logic but I do see things like Logic_500 and InnerLogic_500 etc
Not sure if I'm just doing it wrong or if this is a bug with the Rust lib?
any help greatly appreciated
Beta Was this translation helpful? Give feedback.
All reactions