GUI more stable than before

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-10 01:27:28 -07:00
parent baecdd3d58
commit 6f149c2706
2 changed files with 23 additions and 22 deletions

View File

@ -1,21 +1,22 @@
package main package main
import "log" import "log"
// import "time" import "time"
// import "fmt" import "fmt"
import "github.com/gookit/config" import "github.com/gookit/config"
import "github.com/andlabs/ui" import "github.com/andlabs/ui"
import _ "github.com/andlabs/ui/winmanifest" import _ "github.com/andlabs/ui/winmanifest"
import "git.wit.com/wit/gui"
// import "github.com/davecgh/go-spew/spew" // import "github.com/davecgh/go-spew/spew"
var jwcmainwin *ui.Window var jwcmainwin *ui.Window
var jwcmaintab *ui.Tab var jwcmaintab *ui.Tab
var tabcount int var tabcount int
func makeCloudInfoBox() ui.Control { func makeCloudInfoBox() ui.Control {
hbox := ui.NewHorizontalBox() hbox := ui.NewHorizontalBox()
hbox.SetPadded(true) hbox.SetPadded(true)
@ -158,3 +159,20 @@ func setupCloudUI() {
jwcmainwin.Show() jwcmainwin.Show()
} }
func add2() {
var parts []gui.InputData
for key, foo := range []string{"BG", "TEXTCOLOR", "BUTTON", "TEXTCOLOR", "TEXTCOLOR", "TEXT", "BUTTON", "TEXT", "BUTTON"} {
log.Println(key, foo)
var b gui.InputData
b.CellType = foo
b.Heading = fmt.Sprintf("heading%d", key)
parts = append(parts, b)
}
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)
}

21
main.go
View File

@ -3,14 +3,14 @@ package main
import "log" import "log"
import "os" import "os"
import "time" import "time"
import "fmt" // import "fmt"
import "github.com/gookit/config" import "github.com/gookit/config"
import "github.com/andlabs/ui" import "github.com/andlabs/ui"
import _ "github.com/andlabs/ui/winmanifest" import _ "github.com/andlabs/ui/winmanifest"
import "git.wit.com/wit/gui" // import "git.wit.com/wit/gui"
// import "github.com/davecgh/go-spew/spew" // import "github.com/davecgh/go-spew/spew"
@ -27,23 +27,6 @@ import "git.wit.com/wit/gui"
// always sorted slice (new project) // always sorted slice (new project)
// https://github.com/yaa110/sslice // https://github.com/yaa110/sslice
func add2() {
var parts []gui.InputData
for key, foo := range []string{"BG", "TEXTCOLOR", "BUTTON", "TEXTCOLOR", "TEXTCOLOR", "TEXT", "BUTTON", "TEXT", "BUTTON"} {
log.Println(key, foo)
var b gui.InputData
b.CellType = foo
b.Heading = fmt.Sprintf("heading%d", key)
parts = append(parts, b)
}
log.Println("Sleep for 2 seconds, then try to add new tabs")
time.Sleep(1 * 1000 * 1000 * 1000)
gui.AddTableTab("test seven", 7, parts)
}
func main() { func main() {
parseConfig() parseConfig()