trap window close and exit

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-23 13:45:11 -07:00
parent 41679c718b
commit 87ee1e2be2
1 changed files with 40 additions and 34 deletions

View File

@ -114,9 +114,12 @@ func main() {
func buttonClickNew(b *gui.ButtonMap) { func buttonClickNew(b *gui.ButtonMap) {
log.Println("buttonClickNew() b =", b) 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.Name", b.Name)
log.Println("\tb.Note", b.Note) log.Println("\tb.Note", b.Note)
if (b.Note == "BACK") { if (b.Note == "BACK") {
gui.Data.State = "splash" gui.Data.State = "splash"
} }
@ -153,6 +156,7 @@ func buttonClickNew(b *gui.ButtonMap) {
} }
} }
} }
}
if (gui.Data.State == "splash") { if (gui.Data.State == "splash") {
gui.ShowAccountQuestionTab() gui.ShowAccountQuestionTab()
gui.Data.State = "account1" gui.Data.State = "account1"
@ -163,6 +167,8 @@ func buttonClickNew(b *gui.ButtonMap) {
} else if (gui.Data.State == "main") { } else if (gui.Data.State == "main") {
gui.ShowMainTab() gui.ShowMainTab()
gui.Data.State = "done" gui.Data.State = "done"
} else if (gui.Data.State == "QUIT") {
onExit(nil)
} }
} }