better display and debugging

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-06-03 12:56:33 -07:00
parent 2ce5732053
commit 682fc29bab
2 changed files with 26 additions and 20 deletions

View File

@ -107,7 +107,7 @@ func (ah GuiArea) KeyEvent(a *ui.Area, ke *ui.AreaKeyEvent) (handled bool) {
return false
}
func ShowTextBox(gw *GuiWindow, newText *ui.AttributedString, custom func(*GuiButton)) *GuiBox {
func ShowTextBox(gw *GuiWindow, newText *ui.AttributedString, custom func(*GuiButton), name string) *GuiBox {
log.Println("ShowTextBox() START")
if (gw == nil) {
log.Println("ShowTextBox() ERROR gw = nil")
@ -118,7 +118,7 @@ func ShowTextBox(gw *GuiWindow, newText *ui.AttributedString, custom func(*GuiBu
var newbox *GuiBox
newbox = new(GuiBox)
newbox.Window = gw
newbox.Name = "Hbox1"
newbox.Name = name
hbox := ui.NewVerticalBox()
newbox.UiBox = hbox

View File

@ -20,24 +20,8 @@ func WatchGUI() {
for {
if (count > 20) {
log.Println("Sleep() in watchGUI()")
for i, window := range Data.Windows {
log.Println("watchGUI() Data.Windows", i, "Name =", window.Name)
for name, abox := range window.BoxMap {
log.Printf("\twatchGUI() BOX mapname=%-12s abox.Name=%-12s", name, abox.Name)
/*
if (name == "DEBUG") {
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)
}
*/
}
if (Config.Debug) {
DumpBoxes()
}
count = 0
}
@ -46,6 +30,28 @@ func WatchGUI() {
}
}
func DumpBoxes() {
for i, window := range Data.Windows {
log.Println("watchGUI() Data.Windows", i, "Name =", window.Name)
for name, abox := range window.BoxMap {
log.Printf("\twatchGUI() BOX mapname=%-12s abox.Name=%-12s", name, abox.Name)
/*
if (name == "DEBUG") {
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)
}
*/
}
}
}
func addTableTab() {
var parts []TableColumnData