2019-05-07 21:31:58 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "log"
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
import "github.com/andlabs/ui"
|
|
|
|
import _ "github.com/andlabs/ui/winmanifest"
|
|
|
|
|
2019-05-21 20:00:45 -05:00
|
|
|
import "git.wit.com/wit/gui"
|
2019-05-07 21:31:58 -05:00
|
|
|
|
2019-05-21 20:00:45 -05:00
|
|
|
var cloudwin *ui.Window
|
|
|
|
var cloudtab *ui.Tab
|
|
|
|
var tabcount int
|
2019-05-07 21:31:58 -05:00
|
|
|
|
|
|
|
func main() {
|
2019-05-21 20:00:45 -05:00
|
|
|
// make this the main loop in an attempt to figure out the crashes
|
|
|
|
// do not change this until the GUI is stable
|
|
|
|
ui.Main(setupCloudUI)
|
|
|
|
}
|
|
|
|
|
|
|
|
// can not pass any args to this (?)
|
|
|
|
func setupCloudUI() {
|
|
|
|
cloudwin = ui.NewWindow("Cloud Control Panel", 640, 480, false)
|
|
|
|
cloudwin.OnClosing(func(*ui.Window) bool {
|
|
|
|
ui.Quit()
|
|
|
|
return true
|
|
|
|
})
|
|
|
|
ui.OnShouldQuit(func() bool {
|
|
|
|
cloudwin.Destroy()
|
|
|
|
return true
|
|
|
|
})
|
|
|
|
|
|
|
|
cloudtab = ui.NewTab()
|
|
|
|
cloudwin.SetChild(cloudtab)
|
|
|
|
cloudwin.SetMargined(true)
|
|
|
|
|
|
|
|
tabcount = 0
|
|
|
|
addTableTab()
|
|
|
|
// cloudtab.Append("Cloud Info", makeCloudInfoBox())
|
|
|
|
// cloudtab.SetMargined(tabcount, true)
|
|
|
|
|
|
|
|
cloudwin.Show()
|
|
|
|
}
|
|
|
|
|
|
|
|
func addTableTab() {
|
|
|
|
var parts []gui.TableColumnData
|
|
|
|
|
|
|
|
for key, foo := range []string{"BG", "TEXTCOLOR", "BUTTON", "TEXTCOLOR", "TEXTCOLOR", "TEXT", "BUTTON", "TEXT", "BUTTON"} {
|
|
|
|
log.Println(key, foo)
|
|
|
|
|
|
|
|
var b gui.TableColumnData
|
|
|
|
b.CellType = foo
|
|
|
|
b.Heading = fmt.Sprintf("heading%d", key)
|
|
|
|
parts = append(parts, b)
|
2019-05-07 21:31:58 -05:00
|
|
|
}
|
2019-05-21 20:00:45 -05:00
|
|
|
mh := gui.AddTableTab(cloudtab, 0, "test seven", 7, parts)
|
|
|
|
|
|
|
|
// set some test values as an example
|
|
|
|
mh.Rows[1].HumanData[1].Text = "jwctest1"
|
|
|
|
mh.Rows[2].HumanData[2].Text = "jwctest2"
|
|
|
|
mh.Rows[3].HumanData[3].Text = "jwctest3"
|
|
|
|
mh.Rows[3].HumanData[4].Text = "jwctest4"
|
|
|
|
mh.Rows[2].HumanData[5].Text = "jwctest5"
|
|
|
|
mh.Rows[3].HumanData[6].Text = "jwctest6"
|
|
|
|
mh.Rows[4].HumanData[7].Text = "jwctest7"
|
|
|
|
mh.Rows[5].HumanData[8].Text = "jwctest8"
|
2019-05-07 21:31:58 -05:00
|
|
|
}
|