diff options
| author | Jeff Carr <[email protected]> | 2025-02-05 07:24:14 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-05 07:24:14 -0600 |
| commit | 12f3d5ac5cb4add74eb9a053ae1804c661654d09 (patch) | |
| tree | c70342cf9b59ef9d26493171a52a79df9d660eb1 /place.go | |
| parent | a81e931b9ac830f7812d696e0ecc182fb3a00b7f (diff) | |
set the node.State.Label on SetText()
Diffstat (limited to 'place.go')
| -rw-r--r-- | place.go | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -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 } |
