add a test where literally every GUI thing is isolated in a seperate

goroutine

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-22 18:36:23 -07:00
parent 32990af0fd
commit f3eaf0c5a0
3 changed files with 56 additions and 0 deletions

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ example-table/example-table
test1/test1
test2/test2
test3/test3
test4/test4

6
test4/Makefile Normal file
View File

@ -0,0 +1,6 @@
build:
go build
./test2
run:
go run *.go

49
test4/main.go Normal file
View File

@ -0,0 +1,49 @@
package main
import "log"
import "time"
import "git.wit.com/wit/gui"
var guiDS *gui.GuiDS
func main() {
guiDS = gui.GetDataStructures()
guiDS.ButtonClick = buttonClick
gui.GoMainWindow()
// go gui.GoMainWindow()
watchGUI()
}
func buttonClick(i int, s string) {
log.Println("test2 buttonClick() i, s =", i, s)
gui.ShowAccountTab()
}
func watchGUI() {
log.Println("Sleep(2000)")
time.Sleep(2000 * time.Millisecond)
for {
log.Println("Sleep()")
time.Sleep(200 * time.Millisecond)
if (guiDS.State == "splash") {
log.Println("Display the splash box")
guiDS.State = "done"
}
if (guiDS.State == "kill") {
log.Println("gui.State = kill")
log.Println("gui.State = kill")
log.Println("gui.State = kill")
guiDS.State = "account1"
}
if (guiDS.State == "account1") {
log.Println("Display the splash box")
guiDS.State = "done"
}
}
}