Gui for golang, UI created by ResEdit
import ( "github.com/sumorf/gowi" . "github.com/sumorf/gowi/declarative" "fmt" )
type MyMainWindow struct { *gowi.MainWindow label1 *gowi.Label button1 *gowi.Button }
func main() { app := gowi.New()
mw := new(MyMainWindow)
m := MainWindow{
AssignTo:&mw.MainWindow,
ID:1000,
Controls:[]Control{
Button{
AssignTo:&mw.button1,
ID:1001,
OnClicked:func() {
fmt.Println("Button clicked.")
mw.SetWindowText("Clicked")
},
},
},
}
m.Create()
m.Show()
mw.SetWindowText("Hello")
app.Run()
}
How to design:
Run: