FORMAT: I think somehow I formatted this

This commit is contained in:
Jeff Carr 2021-10-06 11:50:35 -05:00
parent 07061a47e7
commit 62010a8d16
3 changed files with 35 additions and 29 deletions

View File

@ -1,26 +1,28 @@
package gui
import "log"
import "time"
import "fmt"
import (
"fmt"
"log"
"time"
"github.com/davecgh/go-spew/spew"
)
// import "reflect"
// import "github.com/andlabs/ui"
// import _ "github.com/andlabs/ui/winmanifest"
import "github.com/davecgh/go-spew/spew"
// import pb "git.wit.com/wit/witProtobuf"
//
// this watches the GUI primarily to process protobuf's
// this is pointless or wrong but I use it for debugging
// Dump out debugging information every 4 seconds
//
func WatchGUI() {
count := 0
for {
if (count > 20) {
if count > 20 {
log.Println("Sleep() in watchGUI()")
if (Config.Debug) {
if Config.Debug {
DumpBoxes()
}
count = 0
@ -39,7 +41,7 @@ func DumpMap() {
func DumpBoxes() {
for name, window := range Data.WindowMap {
log.Println("gui.DumpBoxes() MAP: ", name)
if (window.TabNumber == nil) {
if window.TabNumber == nil {
log.Println("gui.DumpBoxes() \tWindows.TabNumber = nil")
} else {
log.Println("gui.DumpBoxes() \tWindows.TabNumber =", *window.TabNumber)
@ -50,14 +52,14 @@ func DumpBoxes() {
log.Println("gui.DumpBoxes()\tWindow.UiTab =", window.UiTab)
for name, abox := range window.BoxMap {
log.Printf("gui.DumpBoxes() \tBOX mapname=%-12s abox.Name=%-12s", name, abox.Name)
if (name == "MAINBOX") {
if (Config.Debug) {
if name == "MAINBOX" {
if Config.Debug {
scs := spew.ConfigState{MaxDepth: 1}
scs.Dump(abox.UiBox)
}
}
}
if (window.UiTab != nil) {
if window.UiTab != nil {
// log.Println("gui.DumpBoxes()\tWindow.UiTab type =", reflect.TypeOf(window.UiTab))
// log.Println("gui.DumpBoxes()\tWindow.UiTab =", window.UiTab)
pages := window.UiTab.NumPages()
@ -68,7 +70,7 @@ func DumpBoxes() {
// tmp := spew.NewDefaultConfig()
// tmp.MaxDepth = 2
// tmp.Dump(window.UiTab)
if (Config.Debug) {
if Config.Debug {
scs := spew.ConfigState{MaxDepth: 2}
scs.Dump(window.UiTab)
}

13
gui.go
View File

@ -1,11 +1,14 @@
package gui
import "log"
// import "time"
import "regexp"
import (
"github.com/andlabs/ui" // import "time"
"log"
"regexp"
import "github.com/andlabs/ui"
import _ "github.com/andlabs/ui/winmanifest" // the _ means we only need this for the init()
_ "github.com/andlabs/ui/winmanifest"
)
// the _ means we only need this for the init()
const Xaxis = 0 // box that is horizontal
const Yaxis = 1 // box that is vertical

View File

@ -27,6 +27,7 @@ func makeWindowDebug() ui.Control {
log.Println("range Data.WindowMap() name =", name)
addName(cbox, name)
}
cbox.SetSelected(0)
vbox.Append(cbox, false)