Initialize array with default values and length #2976
Answered
by
ogoffart
Tastaturtaste
asked this question in
Q&A
-
I have a component with a variable and/or large number of elements. I also have an array with one entry for each component. How can I initialize the array without writing the initial default value for every entry in the array?
What I would like:
|
Beta Was this translation helpful? Give feedback.
Answered by
ogoffart
Jun 26, 2023
Replies: 1 comment 3 replies
-
This is i think currently not possible to do in .slint code. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You don't need to use the init callback. (and indeed shouldn't use it for this kind of things)
You can also do something like this: