summaryrefslogtreecommitdiff
path: root/splash.go
diff options
context:
space:
mode:
Diffstat (limited to 'splash.go')
-rw-r--r--splash.go27
1 files changed, 19 insertions, 8 deletions
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
}