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) okButton := gui.CreateButton("OK", "CLOSE", custom)
newbox.Append(okButton, false) newbox.Append(okButton, false)
if (vbox != nil) {
vbox.Append(newbox, true) vbox.Append(newbox, true)
}
return newbox 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/account1"
// import "git.wit.com/wit/cloud-control-panel/account2" // 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 cloudWindow *ui.Window
var cloudTab *ui.Tab
var cloudBox *ui.Box var cloudBox *ui.Box
var smallBox *ui.Box var smallBox *ui.Box
var state string var state string
@ -37,11 +38,14 @@ func main() {
// ui.Main(account2.AddAccountWindow) // ui.Main(account2.AddAccountWindow)
} }
func buttonClick(i int) { func buttonClick(i int, s string) {
log.Println("buttonClick() i =", i) log.Println("buttonClick() i, s =", i, s)
} }
func watchGUI() { func watchGUI() {
log.Println("Sleep(2000)")
time.Sleep(2000 * time.Millisecond)
for { for {
log.Println("Sleep()") log.Println("Sleep()")
time.Sleep(200 * time.Millisecond) time.Sleep(200 * time.Millisecond)
@ -81,18 +85,20 @@ func makeCloudWindow() {
return true return true
}) })
cloudBox = ui.NewVerticalBox() // cloudBox = ui.NewVerticalBox()
cloudBox.SetPadded(true) // cloudBox.SetPadded(true)
cloudWindow.SetChild(cloudBox) // cloudWindow.SetChild(cloudBox)
// cloudWindow.SetMargined(true)
tab := ui.NewTab()
cloudWindow.SetChild(tab)
cloudWindow.SetMargined(true) 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() cloudWindow.Show()
log.Println("cloudBox:") state = "done"
log.Println("cloudBox:")
log.Println("cloudBox:")
spew.Dump(cloudBox)
state = "splash"
} }