makes the main window 'tabbed'

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-22 17:06:33 -07:00
parent 62df742725
commit 41e9f95789
2 changed files with 22 additions and 14 deletions

View File

@ -61,7 +61,9 @@ func ShowSplashBox(vbox *ui.Box, atest chan int, custom func(int, string)) *ui.B
okButton := gui.CreateButton("OK", "CLOSE", custom)
newbox.Append(okButton, false)
vbox.Append(newbox, true)
if (vbox != nil) {
vbox.Append(newbox, true)
}
return newbox
}

View File

@ -10,9 +10,10 @@ import "git.wit.com/wit/cloud-control-panel/splash"
import "git.wit.com/wit/cloud-control-panel/account1"
// import "git.wit.com/wit/cloud-control-panel/account2"
import "github.com/davecgh/go-spew/spew"
// import "github.com/davecgh/go-spew/spew"
var cloudWindow *ui.Window
var cloudTab *ui.Tab
var cloudBox *ui.Box
var smallBox *ui.Box
var state string
@ -37,11 +38,14 @@ func main() {
// ui.Main(account2.AddAccountWindow)
}
func buttonClick(i int) {
log.Println("buttonClick() i =", i)
func buttonClick(i int, s string) {
log.Println("buttonClick() i, s =", i, s)
}
func watchGUI() {
log.Println("Sleep(2000)")
time.Sleep(2000 * time.Millisecond)
for {
log.Println("Sleep()")
time.Sleep(200 * time.Millisecond)
@ -81,18 +85,20 @@ func makeCloudWindow() {
return true
})
cloudBox = ui.NewVerticalBox()
cloudBox.SetPadded(true)
cloudWindow.SetChild(cloudBox)
// cloudBox = ui.NewVerticalBox()
// cloudBox.SetPadded(true)
// cloudWindow.SetChild(cloudBox)
// cloudWindow.SetMargined(true)
tab := ui.NewTab()
cloudWindow.SetChild(tab)
cloudWindow.SetMargined(true)
// splash.ShowSplashBox(cloudBox, nil)
cloudBox = splash.ShowSplashBox(nil, nil, buttonClick)
tab.Append("WIT Splash", cloudBox)
tab.SetMargined(0, true)
// This displays the window
cloudWindow.Show()
log.Println("cloudBox:")
log.Println("cloudBox:")
log.Println("cloudBox:")
spew.Dump(cloudBox)
state = "splash"
state = "done"
}