2019-05-22 20:36:23 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "log"
|
|
|
|
import "time"
|
2019-05-22 22:16:16 -05:00
|
|
|
import "os"
|
2019-05-22 20:36:23 -05:00
|
|
|
|
|
|
|
import "git.wit.com/wit/gui"
|
|
|
|
|
|
|
|
func main() {
|
2019-05-22 23:34:31 -05:00
|
|
|
gui.Data.ButtonClick = buttonClick
|
|
|
|
gui.Data.ButtonClickNew = buttonClickNew
|
2019-05-22 20:36:23 -05:00
|
|
|
|
2019-05-22 21:05:03 -05:00
|
|
|
go gui.GoMainWindow()
|
2019-05-22 20:36:23 -05:00
|
|
|
|
|
|
|
watchGUI()
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:34:31 -05:00
|
|
|
func buttonClickNew(b *gui.ButtonMap) {
|
|
|
|
log.Println("test4 buttonClickNew() b =", b)
|
|
|
|
log.Println("\tb.Name", b.Name)
|
|
|
|
log.Println("\tb.Note", b.Note)
|
|
|
|
|
|
|
|
if (b.Note == "BACK") {
|
2019-05-22 23:17:00 -05:00
|
|
|
gui.Data.State = "splash"
|
|
|
|
}
|
2019-05-22 22:16:16 -05:00
|
|
|
if (gui.Data.State == "splash") {
|
|
|
|
gui.ShowAccountQuestionTab()
|
|
|
|
gui.Data.State = "account1"
|
|
|
|
return
|
|
|
|
} else if (gui.Data.State == "account1") {
|
|
|
|
gui.ShowAccountTab()
|
2019-05-22 23:02:02 -05:00
|
|
|
gui.Data.State = "main"
|
|
|
|
} else if (gui.Data.State == "main") {
|
|
|
|
gui.ShowMainTab()
|
|
|
|
gui.Data.State = "done"
|
2019-05-22 22:16:16 -05:00
|
|
|
}
|
2019-05-22 20:36:23 -05:00
|
|
|
}
|
|
|
|
|
2019-05-22 23:34:31 -05:00
|
|
|
func buttonClick(i int, s string) {
|
|
|
|
log.Println("test4 buttonClick() i, s =", i, s)
|
|
|
|
}
|
|
|
|
|
2019-05-22 20:36:23 -05:00
|
|
|
func watchGUI() {
|
|
|
|
log.Println("Sleep(2000)")
|
|
|
|
time.Sleep(2000 * time.Millisecond)
|
|
|
|
|
|
|
|
for {
|
2019-05-22 23:17:00 -05:00
|
|
|
log.Println("Sleep() in watchGUI() gui.Data.State =", gui.Data.State)
|
|
|
|
time.Sleep(2000 * time.Millisecond)
|
2019-05-22 20:36:23 -05:00
|
|
|
|
2019-05-22 21:05:03 -05:00
|
|
|
if (gui.Data.State == "kill") {
|
2019-05-22 20:36:23 -05:00
|
|
|
log.Println("gui.State = kill")
|
|
|
|
log.Println("gui.State = kill")
|
|
|
|
log.Println("gui.State = kill")
|
2019-05-22 22:16:16 -05:00
|
|
|
os.Exit(0)
|
2019-05-22 20:36:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|