Inline Rust code in (*.slint) file. #2947
Replies: 2 comments 4 replies
-
One of the design goal is to keep the .slint language simple so it forces a separation between UI and logic, and that it allow design tool to open and operate with the file. The other problem is that the error reporting would be terrible since the error would be pointed at in the generated code. (This would be better within the slint macro, and i considered it in #1714 ) Also difficult to access any rust variable from the outside. So now the "easier" is to create a |
Beta Was this translation helpful? Give feedback.
-
I appreciate the separation of ui code and logic code but in some cases it makes sense to customise the generated rust widget struct in the same place as slint code. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to write Rust callback for slint component as Rust function or closure in
*.slint
file?Sometimes it would be more convenient to add non-UI-interactive Rust code (file operation, pure-value computing) in
*.slint
file. It would be impressively efficient for nested component.Beta Was this translation helpful? Give feedback.
All reactions