Created
January 19, 2025 19:24
-
-
Save basdp/90196efdc11d4e0d82117df9051f6371 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Port { | |
x: length, | |
y: length, | |
name: string, | |
} | |
component Node inherits Rectangle { | |
in-out property <[Port]> ports; | |
private property <Port> port: ports[0]; | |
width: 100px; | |
height: 100px; | |
VerticalLayout { | |
HorizontalLayout { | |
Text { | |
text: port.name; | |
} | |
} | |
Rectangle { | |
background: #f8e45c; | |
min-width: 15px; | |
height: 20px; | |
init => { | |
// This line crashes | |
port.y = self.absolute-position.y; | |
} | |
} | |
} | |
} | |
export component Demo inherits Window { | |
background: #242424; | |
min-width: 800px; | |
min-height: 400px; | |
Node { | |
ports: [ | |
{ name: "Port1" }, | |
]; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"main":"main.slint","mappings":{},"slint_version":"1.9.2"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment