trap window close and exit
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
41679c718b
commit
87ee1e2be2
8
main.go
8
main.go
|
@ -114,9 +114,12 @@ func main() {
|
|||
|
||||
func buttonClickNew(b *gui.ButtonMap) {
|
||||
log.Println("buttonClickNew() b =", b)
|
||||
|
||||
if (b == nil) {
|
||||
log.Println("THIS MOUSE EVENT WAS NOT FROM A BUTTON")
|
||||
} else {
|
||||
log.Println("\tb.Name", b.Name)
|
||||
log.Println("\tb.Note", b.Note)
|
||||
|
||||
if (b.Note == "BACK") {
|
||||
gui.Data.State = "splash"
|
||||
}
|
||||
|
@ -153,6 +156,7 @@ func buttonClickNew(b *gui.ButtonMap) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gui.Data.State == "splash") {
|
||||
gui.ShowAccountQuestionTab()
|
||||
gui.Data.State = "account1"
|
||||
|
@ -163,6 +167,8 @@ func buttonClickNew(b *gui.ButtonMap) {
|
|||
} else if (gui.Data.State == "main") {
|
||||
gui.ShowMainTab()
|
||||
gui.Data.State = "done"
|
||||
} else if (gui.Data.State == "QUIT") {
|
||||
onExit(nil)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue