summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debug.go26
-rw-r--r--dropdown.go4
-rw-r--r--eventMouseClick.go1
-rw-r--r--junk1.go4
-rw-r--r--place.go2
5 files changed, 18 insertions, 19 deletions
diff --git a/debug.go b/debug.go
index 7fa8561..3951147 100644
--- a/debug.go
+++ b/debug.go
@@ -8,9 +8,9 @@ import (
)
func (w *guiWidget) dumpTree(s string) {
- // log.Log(ERROR, "dumpTree w", w.node.WidgetId, w.WidgetType, w.String())
+ // log.Log(ERROR, "dump w", w.node.WidgetId, w.WidgetType, w.String())
if w == nil {
- log.Log(ERROR, "dumpTree w.TK == nil", w.node.WidgetId, w.WidgetType, w.String())
+ log.Log(ERROR, "dump w.TK == nil", w.node.WidgetId, w.WidgetType, w.String())
return
}
w.showWidgetPlacement("dumpTree() " + s)
@@ -29,27 +29,29 @@ func (w *guiWidget) showWidgetPlacement(s string) {
} else {
pId = w.node.Parent.WidgetId
}
- s1 = fmt.Sprintf("(wId,pId)=(%2d,%2d) ", w.node.WidgetId, pId)
+ s1 = fmt.Sprintf("(wId,pId)=(%4d,%4d) ", w.node.WidgetId, pId)
sizeW, sizeH := w.Size()
- s1 += fmt.Sprintf("size=(%2d,%2d)", sizeW, sizeH)
+ s1 += fmt.Sprintf("size=(%3d,%3d)", sizeW, sizeH)
if w.Visible() {
- s1 += fmt.Sprintf("gocui=(%2d,%2d,%2d,%2d)",
+ s1 += fmt.Sprintf("gocui=(%3d,%3d,%3d,%3d)",
w.gocuiSize.w0, w.gocuiSize.h0, w.gocuiSize.w1, w.gocuiSize.h1)
} else {
- s1 += fmt.Sprintf(" %2s %2s %2s %2s ", "", "", "", "")
+ s1 += fmt.Sprintf(" %3s %3s %3s %3s ", "", "", "", "")
}
if w.node.Parent != nil {
if w.node.Parent.WidgetType == widget.Grid {
- s1 += fmt.Sprintf("At(%2d,%2d) ", w.node.State.AtW, w.node.State.AtH)
+ s1 += fmt.Sprintf("At(%3d,%3d) ", w.node.State.AtW, w.node.State.AtH)
} else {
- s1 += fmt.Sprintf(" %2s %2s ", "", "")
+ s1 += fmt.Sprintf(" %3s %3s ", "", "")
}
} else {
- s1 += fmt.Sprintf(" %2s %2s ", "", "")
+ s1 += fmt.Sprintf(" %3s %3s ", "", "")
}
- tmp := "." + w.String() + ". " + w.cuiName
+ var end string
if w.node.WidgetType == widget.Box {
- tmp = "." + w.node.State.Direction.String() + ". " + w.cuiName
+ end = fmt.Sprintf("%5s %-8s %s", w.cuiName, w.node.WidgetType, w.node.State.Direction.String())
+ } else {
+ end = fmt.Sprintf("%5s %-8s %s", w.cuiName, w.node.WidgetType, w.String())
}
- log.Log(NOW, s1, s, w.node.WidgetType, ",", tmp) //
+ log.Log(NOW, s1, s, end)
}
diff --git a/dropdown.go b/dropdown.go
index e8cc6d9..fde6a6b 100644
--- a/dropdown.go
+++ b/dropdown.go
@@ -49,7 +49,7 @@ func makeDropdownView(ddItems string) *guiWidget {
func addDropdown() *tree.Node {
n := new(tree.Node)
n.WidgetType = widget.Flag
- n.WidgetId = 2222
+ n.WidgetId = -222
n.ParentId = 0
// store the internal toolkit information
@@ -62,7 +62,7 @@ func addDropdown() *tree.Node {
tk.node.State.Label = "DropBox"
// set the name used by gocui to the id
- tk.cuiName = "-1 dropbox"
+ tk.cuiName = "-1 DR"
tk.color = &colorFlag
diff --git a/eventMouseClick.go b/eventMouseClick.go
index 80a7919..657cbf9 100644
--- a/eventMouseClick.go
+++ b/eventMouseClick.go
@@ -64,7 +64,6 @@ func (w *guiWidget) doWidgetClick() {
child.hideWidgets()
}
}
- // w.dumpTree("click end")
case widget.Checkbox:
if w.node.State.Checked {
log.Log(WARN, "checkbox is being set to false")
diff --git a/junk1.go b/junk1.go
index 1ed2d7e..7a6c4a7 100644
--- a/junk1.go
+++ b/junk1.go
@@ -105,7 +105,7 @@ func addDebugKeys(g *gocui.Gui) {
func(g *gocui.Gui, v *gocui.View) error {
w, h := g.MousePosition()
for _, tk := range findByXY(w, h) {
- log.Log(GOCUI, fmt.Sprintf("findByXY() msgDown() %s wId=%d cuiName=%s at (%d,%d)", tk.WidgetType, tk.node.WidgetId, tk.cuiName, w, h))
+ log.Log(GOCUI, fmt.Sprintf("findByXY() msgDown() %s wId=%d at (%d,%d) %s", tk.WidgetType, tk.node.WidgetId, w, h, tk.node.String()))
}
return nil
})
@@ -152,7 +152,7 @@ func addDebugKeys(g *gocui.Gui) {
g.SetKeybinding("", 'M', gocui.ModNone,
func(g *gocui.Gui, v *gocui.View) error {
w := me.treeRoot.TK.(*guiWidget)
- w.dumpTree("M")
+ w.dumpTree("MM")
return nil
})
diff --git a/place.go b/place.go
index ca0737f..be0a145 100644
--- a/place.go
+++ b/place.go
@@ -35,7 +35,6 @@ func (w *guiWidget) placeBox(startW int, startH int) {
if w.WidgetType != widget.Box {
return
}
- // tk.dumpTree("beforebox")
newW := startW
newH := startH
@@ -58,7 +57,6 @@ func (w *guiWidget) placeBox(startW int, startH int) {
}
log.Log(INFO, "BOX END size(W,H) =", sizeW, sizeH, "new(W,H) =", newW, newH)
}
- // tk.dumpTree("afterbox")
}
func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) {