Closed ghost closed 3 months ago
I would opt for a more descriptive name than _
like maybe UserDataDialog
:
import { StandardButton, GridBox, LineEdit } from "std-widgets.slint";
component UserDataDialog inherits Dialog {
property name <=> name-le.text;
property address <=> address-le.text;
StandardButton { kind: ok; }
StandardButton { kind: cancel; }
preferred-width: 300px;
GridBox {
Row {
Text { text: "Enter your name:"; }
name-le := LineEdit { }
}
Row {
Text { text: "Address:"; }
address-le := LineEdit { }
}
}
}
Basically X := Foo { }
becomes component X inherits Foo {}
, but actually component X { }
works now, too.
You might also want to export
the components you want to access from your business logic or from other .slint files, which would turn the above into export component UserDataDialog inherits Dialog {
.
I hope this helps!
@hunger thank you and would it be possible to export the variable that we are reading in Text to another variable by shadowing the variable or implementing the hostig. Let me know.
I get to learn the SlintUI first through shell and then putting the javascript and rust later on for some of the applications development. Thank you, Gaurav
if i take this as a code template
then the declarable gives
any solution for this.