summaryrefslogtreecommitdiff
path: root/gocui/place.go
diff options
context:
space:
mode:
Diffstat (limited to 'gocui/place.go')
-rw-r--r--gocui/place.go24
1 files changed, 13 insertions, 11 deletions
diff --git a/gocui/place.go b/gocui/place.go
index f4b5edd..80b03ca 100644
--- a/gocui/place.go
+++ b/gocui/place.go
@@ -2,6 +2,8 @@ package main
import (
"strings"
+
+ "go.wit.com/log"
"go.wit.com/gui/widget"
)
@@ -9,7 +11,7 @@ func (n *node) placeBox(startW int, startH int) {
if (n.WidgetType != widget.Box) {
return
}
- n.showWidgetPlacement(logNow, "boxS()")
+ n.showWidgetPlacement(true, "boxS()")
newW := startW
newH := startH
@@ -20,11 +22,11 @@ func (n *node) placeBox(startW int, startH int) {
w := newR.w1 - newR.w0
h := newR.h1 - newR.h0
if (n.horizontal) {
- log(logNow, "BOX IS HORIZONTAL", n.Name, "newWH()", newW, newH, "child()", w, h, child.Name)
+ log.Log(NOW, "BOX IS HORIZONTAL", n.Name, "newWH()", newW, newH, "child()", w, h, child.Name)
// expand based on the child width
newW += w
} else {
- log(logNow, "BOX IS VERTICAL ", n.Name, "newWH()", newW, newH, "child()", w, h, child.Name)
+ log.Log(NOW, "BOX IS VERTICAL ", n.Name, "newWH()", newW, newH, "child()", w, h, child.Name)
// expand based on the child height
newH += h
}
@@ -33,7 +35,7 @@ func (n *node) placeBox(startW int, startH int) {
// just compute this every time?
// newR := n.realGocuiSize()
- n.showWidgetPlacement(logNow, "boxE()")
+ n.showWidgetPlacement(true, "boxE()")
}
func (n *node) placeWidgets(startW int, startH int) {
@@ -62,7 +64,7 @@ func (n *node) placeWidgets(startW int, startH int) {
case widget.Group:
// move the group to the parent's next location
n.gocuiSetWH(startW, startH)
- n.showWidgetPlacement(logNow, "group()")
+ n.showWidgetPlacement(true, "group()")
newW := startW + me.GroupPadW
newH := startH + 3 // normal hight of the group label
@@ -84,7 +86,7 @@ func (n *node) placeWidgets(startW int, startH int) {
func (n *node) placeGrid(startW int, startH int) {
w := n.tk
- n.showWidgetPlacement(logInfo, "grid0:")
+ n.showWidgetPlacement(true, "grid0:")
if (n.WidgetType != widget.Grid) {
return
}
@@ -103,12 +105,12 @@ func (n *node) placeGrid(startW int, startH int) {
w.heights[child.AtH] = childH
}
// child.showWidgetPlacement(logInfo, "grid: ")
- log(logVerbose, "placeGrid:", child.Name, "child()", childW, childH, "At()", child.AtW, child.AtH)
+ log.Log(INFO, "placeGrid:", child.Name, "child()", childW, childH, "At()", child.AtW, child.AtH)
}
// find the width and height offset of the grid for AtW,AtH
for _, child := range n.children {
- child.showWidgetPlacement(logInfo, "grid1:")
+ child.showWidgetPlacement(true, "grid1:")
var totalW, totalH int
for i, w := range w.widths {
@@ -126,11 +128,11 @@ func (n *node) placeGrid(startW int, startH int) {
newW := startW + totalW
newH := startH + totalH
- log(logVerbose, "placeGrid:", child.Name, "new()", newW, newH, "At()", child.AtW, child.AtH)
+ log.Log(INFO, "placeGrid:", child.Name, "new()", newW, newH, "At()", child.AtW, child.AtH)
child.placeWidgets(newW, newH)
- child.showWidgetPlacement(logInfo, "grid2:")
+ child.showWidgetPlacement(true, "grid2:")
}
- n.showWidgetPlacement(logInfo, "grid3:")
+ n.showWidgetPlacement(true, "grid3:")
}
// computes the real, actual size of all the gocli objects in a widget