parent
2330e0a2b6
commit
8b71cd76e5
24
infoTabUI.go
24
infoTabUI.go
|
@ -13,8 +13,8 @@ import "git.wit.com/wit/gui"
|
|||
|
||||
// import "github.com/davecgh/go-spew/spew"
|
||||
|
||||
var jwcmainwin *ui.Window
|
||||
var jwcmaintab *ui.Tab
|
||||
var cloudwin *ui.Window
|
||||
var cloudtab *ui.Tab
|
||||
var tabcount int
|
||||
|
||||
func makeCloudInfoBox() ui.Control {
|
||||
|
@ -114,25 +114,25 @@ func makeCloudInfoBox() ui.Control {
|
|||
}
|
||||
|
||||
func setupCloudUI() {
|
||||
jwcmainwin = ui.NewWindow("Cloud Control Panel", config.Int("width"), config.Int("height"), false)
|
||||
jwcmainwin.OnClosing(func(*ui.Window) bool {
|
||||
cloudwin = ui.NewWindow("Cloud Control Panel", config.Int("width"), config.Int("height"), false)
|
||||
cloudwin.OnClosing(func(*ui.Window) bool {
|
||||
ui.Quit()
|
||||
return true
|
||||
})
|
||||
ui.OnShouldQuit(func() bool {
|
||||
jwcmainwin.Destroy()
|
||||
cloudwin.Destroy()
|
||||
return true
|
||||
})
|
||||
|
||||
jwcmaintab = ui.NewTab()
|
||||
jwcmainwin.SetChild(jwcmaintab)
|
||||
jwcmainwin.SetMargined(true)
|
||||
cloudtab = ui.NewTab()
|
||||
cloudwin.SetChild(cloudtab)
|
||||
cloudwin.SetMargined(true)
|
||||
|
||||
tabcount = 0
|
||||
jwcmaintab.Append("Cloud Info", makeCloudInfoBox())
|
||||
jwcmaintab.SetMargined(tabcount, true)
|
||||
cloudtab.Append("Cloud Info", makeCloudInfoBox())
|
||||
cloudtab.SetMargined(tabcount, true)
|
||||
|
||||
jwcmainwin.Show()
|
||||
cloudwin.Show()
|
||||
}
|
||||
|
||||
func add2() {
|
||||
|
@ -149,5 +149,5 @@ func add2() {
|
|||
|
||||
log.Println("Sleep for 2 seconds, then try to add new tabs")
|
||||
time.Sleep(1 * 1000 * 1000 * 1000)
|
||||
gui.AddTableTab(jwcmaintab, 1, "test seven", 7, parts)
|
||||
gui.AddTableTab(cloudtab, 1, "test seven", 7, parts)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue