final cleanup on the generic mouse click code

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-06-15 00:04:05 -07:00
parent 1987996ba2
commit 9dc75044d7
2 changed files with 13 additions and 19 deletions

View File

@ -58,7 +58,7 @@ func makeCloudInfoBox(gw *gui.GuiWindow) {
log.Println("makeCloudInfoBox() Add Account")
createAccount(box.Window)
})
makeButton(Xbox, nil, nil, "Quit", "QUIT", func (*gui.GuiButton) {
makeButton(Xbox, nil, nil, "Quit", "JUNK", func (*gui.GuiButton) {
onExit(nil)
})
makeButton(Xbox, nil, nil, "Debug", "DEBUG", debugClick)

View File

@ -47,6 +47,9 @@ func mainMouseClick(b *gui.GuiButton) {
if (b == nil) {
log.Println("mainMouseClick() BACK IN MAIN CONTROL PANEL CODE (button is nil) WHY DID THIS HAPPEN?")
log.Println("THIS IS PROBABLY A BUG IN git.wit.com/gui")
// gui.ErrorWindow(gw,
// "Unknown Mouse Event",
// "Error in mainMouseClick()")
onExit(fmt.Errorf("mainMouseClick() got b = nil"))
}
log.Println("mainMouseClick() BACK IN CONTROL PANEL CODE")
@ -55,32 +58,23 @@ func mainMouseClick(b *gui.GuiButton) {
if (gw == nil) {
log.Println("\tTHIS BUTTON IS BROKEN gw = nil")
panic("something")
gui.ErrorWindow(gw,
"Unknown Mouse Event",
"Error in mainMouseClick()")
// panic("something")
return
}
var values *myButtonInfo
if tmp, ok := b.Values.(*myButtonInfo); ! ok {
log.Println("\tmainMouseClick() values.Accounts error =", ok)
log.Println("\tmainMouseClick() values.Accounts tmp =", tmp)
} else {
var values *myButtonInfo
values = tmp
}
log.Println("\tmainMouseClick() values.Accounts =", values.Accounts)
log.Println("\tmainMouseClick() values.Name = ", values.Name)
/*
if (values.Action == "QUIT") {
onExit(nil)
} else if (values.Action == "CREATE") {
log.Println("\tTRY TO ADD A NEW VIRTUAL MACHINE")
createVmClick(b)
} else if (values.Action == "SHOW") {
showAccountClick(b)
log.Println("\tmainMouseClick() values.Action =", values.Action)
}
*/
log.Println("mainMouseClick() BACK IN CONTROL PANEL CODE")
log.Println("mainMouseClick() FAILED TO FIND values.Action =", values.Action)
log.Println("mainMouseClick() END")
}