2019-05-22 20:35:00 -05:00
|
|
|
package gui
|
|
|
|
|
|
|
|
import "log"
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
import "github.com/andlabs/ui"
|
|
|
|
import _ "github.com/andlabs/ui/winmanifest"
|
|
|
|
|
|
|
|
// import "github.com/davecgh/go-spew/spew"
|
|
|
|
|
2019-05-22 21:05:25 -05:00
|
|
|
// var cloudWindow *ui.Window
|
2019-05-22 20:35:00 -05:00
|
|
|
var cloudTab *ui.Tab
|
|
|
|
var cloudBox *ui.Box
|
|
|
|
var smallBox *ui.Box
|
|
|
|
var state string
|
|
|
|
|
|
|
|
func splashClose(a int, b string) {
|
|
|
|
log.Println("GOT splashClose(a,b) =", a, b)
|
|
|
|
|
|
|
|
log.Println("cloudBox Delete(0) START")
|
|
|
|
cloudBox.Delete(0)
|
|
|
|
log.Println("smallBox.Hide() START")
|
|
|
|
smallBox.Hide()
|
|
|
|
|
|
|
|
state = "kill"
|
|
|
|
}
|
|
|
|
|
|
|
|
func buttonClick(i int, s string) {
|
2019-05-22 21:05:25 -05:00
|
|
|
log.Println("gui.buttonClick() i, s =", i, s)
|
|
|
|
log.Println("Figure out what to do here")
|
|
|
|
log.Println("Figure out what to do here")
|
|
|
|
log.Println("Figure out what to do here")
|
2019-05-22 20:35:00 -05:00
|
|
|
|
2019-05-22 21:18:55 -05:00
|
|
|
if (Data.ButtonClick != nil) {
|
|
|
|
log.Println("Data.ButtonClick() START")
|
|
|
|
Data.ButtonClick(i, s)
|
|
|
|
}
|
2019-05-22 20:35:00 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func ShowAccountTab() {
|
|
|
|
cloudTab.Delete(0)
|
|
|
|
|
|
|
|
log.Println("Sleep(1000)")
|
|
|
|
time.Sleep(1000 * time.Millisecond)
|
|
|
|
|
|
|
|
smallBox = AddAccountBox(nil, splashClose)
|
|
|
|
cloudTab.InsertAt("Intro", 0, smallBox)
|
|
|
|
cloudTab.SetMargined(0, true)
|
|
|
|
}
|
|
|
|
|
|
|
|
func GoMainWindow() {
|
|
|
|
ui.Main(makeCloudWindow)
|
|
|
|
}
|
|
|
|
|
|
|
|
func makeCloudWindow() {
|
2019-05-22 21:05:25 -05:00
|
|
|
Data.cloudWindow = ui.NewWindow("", 640, 480, true)
|
2019-05-22 20:35:00 -05:00
|
|
|
// cloudWindow.SetBorderless(true)
|
2019-05-22 21:05:25 -05:00
|
|
|
Data.cloudWindow.OnClosing(func(*ui.Window) bool {
|
2019-05-22 20:35:00 -05:00
|
|
|
ui.Quit()
|
|
|
|
return true
|
|
|
|
})
|
|
|
|
ui.OnShouldQuit(func() bool {
|
2019-05-22 21:05:25 -05:00
|
|
|
Data.cloudWindow.Destroy()
|
2019-05-22 20:35:00 -05:00
|
|
|
return true
|
|
|
|
})
|
|
|
|
|
|
|
|
cloudTab = ui.NewTab()
|
2019-05-22 21:05:25 -05:00
|
|
|
Data.cloudWindow.SetChild(cloudTab)
|
|
|
|
Data.cloudWindow.SetMargined(true)
|
2019-05-22 20:35:00 -05:00
|
|
|
|
|
|
|
cloudBox = ShowSplashBox(nil, nil, buttonClick)
|
|
|
|
|
|
|
|
cloudTab.Append("WIT Splash", cloudBox)
|
|
|
|
cloudTab.SetMargined(0, true)
|
|
|
|
|
2019-05-22 21:05:25 -05:00
|
|
|
Data.cloudWindow.Show()
|
|
|
|
Data.State = "splash done"
|
2019-05-22 20:35:00 -05:00
|
|
|
}
|