From a6368b7b7111758492d06f2ab9ee513dddd7197e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 29 May 2019 19:57:15 -0700 Subject: large change to track the window everywhere Signed-off-by: Jeff Carr --- splash.go | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'splash.go') diff --git a/splash.go b/splash.go index 5568d99..168286a 100644 --- a/splash.go +++ b/splash.go @@ -4,22 +4,31 @@ package gui // import "time" // import "fmt" -// import "log" +import "os" +import "log" import "runtime" import "github.com/andlabs/ui" import _ "github.com/andlabs/ui/winmanifest" -func ShowSplashBox(newText *ui.AttributedString) *ui.Box { +func ShowSplashBox(wm *WindowMap, i int, newText *ui.AttributedString) *ui.Box { + log.Println("ShowSplashBox() START") + log.Println("ShowSplashBox() START wm =", wm) + if (wm == nil) { + log.Println("ShowSplashBox() WE ARE FUCKED BECAUSE WE DON'T KNOW WHAT WINDOW TO DO THIS IN") + os.Exit(0) + return nil + } newbox := ui.NewVerticalBox() newbox.SetPadded(true) // initialize the AreaHandler{} - Data.Window1.AH = new(AreaHandler) - Data.Window1.AH.Attrstr = newText - makeSplashArea(Data.Window1.AH) + Data.Windows[i].AH = new(AreaHandler) + Data.Windows[i].AH.WM = wm + Data.Windows[i].AH.Attrstr = newText + makeSplashArea(Data.Windows[i].AH) - newbox.Append(Data.Window1.AH.Area, true) + newbox.Append(Data.Windows[i].AH.Area, true) if runtime.GOOS == "linux" { newbox.Append(ui.NewLabel("OS: Linux"), false) @@ -47,9 +56,11 @@ func ShowSplashBox(newText *ui.AttributedString) *ui.Box { } } - okButton := CreateButton(nil, nil, "OK", "AREA", nil) + log.Println("ShowSplashBox() START wm =", wm) + okButton := CreateButton(wm, nil, nil, "OK", "AREA", nil) newbox.Append(okButton, false) - newbox.Append(CreateButton(nil, nil, "NEWTEXT", "NEWTEXT", nil), false) + newbox.Append(CreateButton(wm, nil, nil, "NEWTEXT", "NEWTEXT", nil), false) + // os.Exit(0) return newbox } -- cgit v1.2.3