summaryrefslogtreecommitdiff
path: root/debug.go
blob: daf314352c9a2b0605c67e7c8ab1bf9cf67f5bdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package gui

import "log"
import "time"
import "fmt"
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 IS NOT CLEAN
//
// this watches the GUI primarily to process protobuf's
// this is pointless or wrong but I use it for debugging
//
func WatchGUI() {
	count := 0

	for {
		if (count > 20) {
			log.Println("Sleep() in watchGUI() Data.State =", Data.State)
			for i, window := range Data.Windows {
				log.Println("watchGUI() Data.Windows", i, "Action =", window.Action)
				for name, abox := range window.BoxMap {
					log.Println("\twatchGUI() BOX name =", name)
					if (name == "SplashArea3") {
						log.Println("\t\twatchGUI() BOX abox =", reflect.TypeOf(abox))
						win := abox.Window
						log.Println("\t\twatchGUI() BOX win =", reflect.TypeOf(win))
						area := win.Area
						log.Println("\t\twatchGUI() BOX area =", reflect.TypeOf(area), area.UiArea)
						// spew.Dump(area.UiArea)
						// area.UiArea.Show()
						// time.Sleep(2000 * time.Millisecond)
						// os.Exit(0)
					}
				}
			}
			count = 0
		}
		count += 1
		time.Sleep(200 * time.Millisecond)
	}
}

func addTableTab() {
	var parts []TableColumnData

	for key, foo := range []string{"BG", "TEXTCOLOR", "BUTTON", "TEXTCOLOR", "TEXTCOLOR", "TEXT", "BUTTON", "TEXT", "BUTTON"} {
		log.Println(key, foo)

		var b TableColumnData
		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)
	// AddTableTab(Data.Window1.T, 1, "test seven", 7, parts, nil)
}

/*
func runTestHide(b *GuiButton) {
	log.Println("runTestHide START")
	Data.Window1.Box1.Hide()
	Data.Window1.Box2.Hide()
	// time.Sleep(2000 * time.Millisecond)
	Data.State = "HIDE"
	log.Println("runTestHide END")
}
*/