Replies: 1 comment 1 reply
-
struct Item {
id:int,
name:string,
}
export component Example {
property <[int]> list;
property <Item> one-item;
property <[Item]> items;
property <{x:int, y:int, z:int}> point;
property <[{x:int, y:int, z:int}]> points;
callback select-element(string, int, length, length);
} defined properties can also be a struct and a list. If "in-out / in / out" is not added, then this attribute can be used as a private variable. The identifier in the callback is meaningless; it is the same as declaring a callback directly with the type. And for the type-suffix definition method, if you don't want to append "in-out / in / out", it would conflict with the syntax for setting property values, right? //example
text: string;
text: "string"; Btw, I am not a Slint developer, this is just my personal understanding. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As far as I know defined properies can be only of primitive types. Is this correct?
Syntax: For the definition of extra properties you use '<generic> type first' definition in opposite to named arguments ('type last').
Why is the keyword property required? Can a component have other members?
Beta Was this translation helpful? Give feedback.
All reactions