Skip to content

Instantly share code, notes, and snippets.

@basdp
Created January 19, 2025 19:24
Show Gist options
  • Save basdp/90196efdc11d4e0d82117df9051f6371 to your computer and use it in GitHub Desktop.
Save basdp/90196efdc11d4e0d82117df9051f6371 to your computer and use it in GitHub Desktop.
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" },
];
}
}
{"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