I am making a GUI for my app, using package lxn/walk. I'm trying to figure out how to place elements by pixels. My code is like this:
package main
import (
"github.com/lxn/walk"
. "github.com/lxn/walk/declarative"
)
var edit *walk.Label
func main() {
MainWindow{
Title: "FetchTest",
MinSize: Size{600, 400},
Layout: VBox{},
Children: []Widget{
Label{
AssignTo: &edit,
Text: "Hello",
},
PushButton{
Text: "GET DATA",
OnClicked: func() {
},
},
},
}.Run()
edit.SetBounds(walk.Rectangle{10, 5, 50, 50})
}
But this doesn't work since the code that sets the position of label is not executing.
Where to use edit.SetBounds(walk.Rectangle{10, 5, 50, 50}
so the element is shown at the given coordinates?