summaryrefslogtreecommitdiff
path: root/place.go
diff options
context:
space:
mode:
Diffstat (limited to 'place.go')
-rw-r--r--place.go19
1 files changed, 18 insertions, 1 deletions
diff --git a/place.go b/place.go
index 2c04f3d..7ba8a48 100644
--- a/place.go
+++ b/place.go
@@ -4,6 +4,7 @@
package main
import (
+ "fmt"
"strings"
"go.wit.com/log"
@@ -86,14 +87,24 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) {
return startW, startH
case widget.Tab:
case widget.Grid:
+ tk.dumpWidget(fmt.Sprintf("PlaceGridS(%d,%d)", startW, startH))
+ // reset the widths and heights maps here
+ tk.widths = make(map[int]int) // how tall each row in the grid is
+ tk.heights = make(map[int]int) // how wide each column in the grid is
newW, newH := tk.placeGrid(startW, startH)
tk.full.w0 = newW
tk.full.h0 = newH
+ tk.full.w1 = newW
+ tk.full.h1 = newH
+ tk.dumpWidget(fmt.Sprintf("PlaceGridE(%d,%d)", newW, newH))
return newW, newH
case widget.Box:
tk.placeBox(startW, startH)
tk.full.w0 = startW
tk.full.h0 = startH
+ tk.full.w1 = startW
+ tk.full.h1 = startH
+ tk.dumpWidget(fmt.Sprintf("PlaceBox(%d,%d)", startW, startH))
return 0, 0
case widget.Stdout:
tk.setStdoutWH(startW, startH)
@@ -103,6 +114,8 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) {
tk.gocuiSetWH(startW, startH)
tk.full.w0 = startW
tk.full.h0 = startH
+ tk.full.w1 = startW
+ tk.full.h1 = startH
newW := startW + me.GroupPadW
newH := startH + 1 // normal hight of the group label
@@ -121,7 +134,9 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) {
}
log.Log(INFO, "REAL HEIGHT sizeW:", sizeW, "sizeH:", sizeH)
}
- return maxW, newH - startH
+ newH = newH - startH
+ tk.dumpWidget(fmt.Sprintf("PlaceGroup(%d,%d)", maxW, newH))
+ return maxW, newH
default:
tk.gocuiSetWH(startW, startH)
return tk.gocuiSize.Width(), tk.gocuiSize.Height()
@@ -188,6 +203,8 @@ func (w *guiWidget) placeGrid(startW int, startH int) (int, int) {
// child.showWidgetPlacement("grid2:")
}
// w.showWidgetPlacement("grid3:")
+ w.full.w1 = startW + maxW
+ w.full.h1 = startH + maxH
return maxW, maxH
}