final cleanup on the generic mouse click code
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
1987996ba2
commit
9dc75044d7
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
log.Println("\tmainMouseClick() values.Action =", values.Action)
|
||||
}
|
||||
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("mainMouseClick() BACK IN CONTROL PANEL CODE")
|
||||
log.Println("mainMouseClick() FAILED TO FIND values.Action =", values.Action)
|
||||
log.Println("mainMouseClick() END")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue