2019-05-22 20:36:23 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "log"
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
import "git.wit.com/wit/gui"
|
|
|
|
|
|
|
|
func main() {
|
2019-05-22 21:05:03 -05:00
|
|
|
gui.Data.ButtonClick = buttonClick
|
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()
|
|
|
|
}
|
|
|
|
|
|
|
|
func buttonClick(i int, s string) {
|
2019-05-22 21:05:03 -05:00
|
|
|
log.Println("test4 buttonClick() i, s =", i, s)
|
2019-05-22 20:36:23 -05:00
|
|
|
gui.ShowAccountTab()
|
2019-05-22 21:05:03 -05:00
|
|
|
gui.Data.State = "account1 done"
|
2019-05-22 20:36:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func watchGUI() {
|
|
|
|
log.Println("Sleep(2000)")
|
|
|
|
time.Sleep(2000 * time.Millisecond)
|
|
|
|
|
|
|
|
for {
|
2019-05-22 21:05:03 -05:00
|
|
|
log.Println("Sleep()", gui.Data.State)
|
2019-05-22 20:36:23 -05:00
|
|
|
time.Sleep(200 * time.Millisecond)
|
|
|
|
|
2019-05-22 21:05:03 -05:00
|
|
|
if (gui.Data.State == "splash") {
|
2019-05-22 20:36:23 -05:00
|
|
|
log.Println("Display the splash box")
|
2019-05-22 21:05:03 -05:00
|
|
|
gui.Data.State = "done"
|
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 21:05:03 -05:00
|
|
|
gui.Data.State = "account1"
|
2019-05-22 20:36:23 -05:00
|
|
|
}
|
2019-05-22 21:05:03 -05:00
|
|
|
if (gui.Data.State == "account1") {
|
2019-05-22 20:36:23 -05:00
|
|
|
log.Println("Display the splash box")
|
2019-05-22 21:05:03 -05:00
|
|
|
gui.Data.State = "done"
|
2019-05-22 20:36:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|