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:
parent
32990af0fd
commit
f3eaf0c5a0
|
@ -10,3 +10,4 @@ example-table/example-table
|
|||
test1/test1
|
||||
test2/test2
|
||||
test3/test3
|
||||
test4/test4
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
build:
|
||||
go build
|
||||
./test2
|
||||
|
||||
run:
|
||||
go run *.go
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue