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

13
gui.go
View File

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

View File

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