59 lines
1.1 KiB
Go
59 lines
1.1 KiB
Go
package main
|
|
|
|
import "log"
|
|
import "time"
|
|
import "os"
|
|
|
|
import "git.wit.com/wit/gui"
|
|
|
|
func main() {
|
|
gui.Data.ButtonClick = buttonClick
|
|
gui.Data.ButtonClickNew = buttonClickNew
|
|
|
|
go gui.GoMainWindow()
|
|
|
|
watchGUI()
|
|
}
|
|
|
|
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") {
|
|
gui.Data.State = "splash"
|
|
}
|
|
if (gui.Data.State == "splash") {
|
|
gui.ShowAccountQuestionTab()
|
|
gui.Data.State = "account1"
|
|
return
|
|
} else if (gui.Data.State == "account1") {
|
|
gui.ShowAccountTab()
|
|
gui.Data.State = "main"
|
|
} else if (gui.Data.State == "main") {
|
|
gui.ShowMainTab()
|
|
gui.Data.State = "done"
|
|
}
|
|
}
|
|
|
|
func buttonClick(i int, s string) {
|
|
log.Println("test4 buttonClick() i, s =", i, s)
|
|
}
|
|
|
|
func watchGUI() {
|
|
log.Println("Sleep(2000)")
|
|
time.Sleep(2000 * time.Millisecond)
|
|
|
|
for {
|
|
log.Println("Sleep() in watchGUI() gui.Data.State =", gui.Data.State)
|
|
time.Sleep(2000 * time.Millisecond)
|
|
|
|
if (gui.Data.State == "kill") {
|
|
log.Println("gui.State = kill")
|
|
log.Println("gui.State = kill")
|
|
log.Println("gui.State = kill")
|
|
os.Exit(0)
|
|
}
|
|
}
|
|
}
|