func main() { app := gowi.New() mw := &MyMainWindow{} m := MainWindow{ AssignTo: &mw.MainWindow, ID: 108, Controls: []Control{ TabControl{ AssignTo: &mw.tab1, ID: 40000, }, }, } m.Create() m.Show() app.Run() }
func main() { app := gowi.New() mw := new(MyMainWindow) m := MainWindow{ AssignTo: &mw.MainWindow, ID: 100, Controls: []Control{ Label{ AssignTo: &mw.label1, ID: 1002, Text: "????", }, LineEdit{ AssignTo: &mw.lineedit1, ID: 40004, Text: "abc", }, Button{ AssignTo: &mw.button1, ID: 1001, Text: "Click Me!", OnClicked: func() { fmt.Println("Button clicked.") //ll := mw.lineedit1.GetWindowText() //fmt.Printf("ll=%v\n", ll) }, }, }, } m.Create() m.Show() mw.SetWindowText("Hello!") app.Run() }