Replies: 1 comment
-
export struct AnotherStruct {
id: int,
text: string,
}
export struct SomeStruct {
name: string,
items: [AnotherStruct],
}
export component Demo {
in-out property <[SomeStruct]> some: [
{
name: "struct 1",
items: [
{ id: 1, text: "1st" },
{ id: 2, text: "2nd" },
{ id: 3, text: "3rd" },
]
},
{
name: "struct 2",
items: [
{ id: 100, text: "haha" },
]
},
];
}
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an application that expose as a property an array of SomeStruct that I modify from rust to affect the UI.
Now I'd like that SomeStruct to contain a member that is an array of AnotherStruct.
I can't find how to do that. It seems like array of struct can only be as a property and a property can't be a member of a struct.
Is it possible to achieve something like that with Slint?
And while trying to search for an alternative, if it's not possible, I would need to use a long array, how can I initialize a long array of structs without specifying the same data over and over again? I couldn't find how to do that either.
Beta Was this translation helpful? Give feedback.
All reactions