diff --git a/area.go b/area.go index 46b77f7..b901e4f 100644 --- a/area.go +++ b/area.go @@ -7,10 +7,6 @@ import _ "github.com/andlabs/ui/winmanifest" import "github.com/davecgh/go-spew/spew" -func areaClick(a int, b string) { - log.Println("GOT areaClick(a,b) =", a, b) -} - func makeSplashArea(custom func(int, string)) *ui.Area { // make this button just to get the default font (but don't display the button) // There should be another way to do this (?) @@ -80,7 +76,9 @@ func (ah areaHandler) Draw(a *ui.Area, p *ui.AreaDrawParams) { func (ah areaHandler) MouseEvent(a *ui.Area, me *ui.AreaMouseEvent) { log.Println("GOT MouseEvent()") - spew.Dump(me) + if (Data.Debug) { + spew.Dump(me) + } if (me.Down == 1) { log.Println("GOT MOUSE DOWN") log.Println("GOT MOUSE DOWN") @@ -90,10 +88,10 @@ func (ah areaHandler) MouseEvent(a *ui.Area, me *ui.AreaMouseEvent) { log.Println("GOT MOUSE UP") log.Println("GOT MOUSE UP") log.Println("GOT MOUSE UP") - // splashWin.Destroy() - // ui.Quit() + if (Data.ButtonClickNew != nil) { + Data.ButtonClickNew(nil) + } } - areaClick(1, "done") } func (ah areaHandler) MouseCrossed(a *ui.Area, left bool) { diff --git a/splash.go b/splash.go index 035b5ad..829e361 100644 --- a/splash.go +++ b/splash.go @@ -30,13 +30,15 @@ func ShowSplashBox(vbox *ui.Box, atest chan int, custom func(int, string)) *ui.B version := "Version: " + Data.Version newbox.Append(ui.NewLabel(version), false) - if (Data.GitCommit != "") { - tmp := "git rev-list: " + Data.GitCommit - newbox.Append(ui.NewLabel(tmp), false) - } - if (Data.GoVersion != "") { - tmp := "go build version: " + Data.GoVersion - newbox.Append(ui.NewLabel(tmp), false) + if (Data.Debug) { + if (Data.GitCommit != "") { + tmp := "git rev-list: " + Data.GitCommit + newbox.Append(ui.NewLabel(tmp), false) + } + if (Data.GoVersion != "") { + tmp := "go build version: " + Data.GoVersion + newbox.Append(ui.NewLabel(tmp), false) + } } okButton := CreateButton("OK", "DONE", custom) diff --git a/tabWindow.go b/tabWindow.go index 5b42bf3..f7a824d 100644 --- a/tabWindow.go +++ b/tabWindow.go @@ -61,11 +61,21 @@ func makeCloudWindow() { Data.cloudWindow = ui.NewWindow("", 640, 480, true) // cloudWindow.SetBorderless(true) Data.cloudWindow.OnClosing(func(*ui.Window) bool { - ui.Quit() + if (Data.ButtonClickNew != nil) { + log.Println("Data.ButtonClickNew() START QUIT") + Data.State = "QUIT" + Data.ButtonClickNew(nil) + } + // ui.Quit() return true }) ui.OnShouldQuit(func() bool { - Data.cloudWindow.Destroy() + if (Data.ButtonClickNew != nil) { + log.Println("Data.ButtonClickNew() START QUIT") + Data.State = "QUIT" + Data.ButtonClickNew(nil) + } + // Data.cloudWindow.Destroy() return true })