diff options
| author | Jeff Carr <[email protected]> | 2023-04-04 06:31:30 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-04-04 06:31:30 -0500 |
| commit | d6b1fa497dcb21e194348d321bfc25f6b128438f (patch) | |
| tree | e653d621c1302dd58de4b8b280cd13f613e518b7 /toolkit/gocui/click.go | |
| parent | 8982b2a8cfb10ad2ac2e50c0fcbdad88556e495a (diff) | |
gocui: use (w,h) and avoid (x,y) names
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/gocui/click.go')
| -rw-r--r-- | toolkit/gocui/click.go | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/toolkit/gocui/click.go b/toolkit/gocui/click.go index ce61bb7..41b8780 100644 --- a/toolkit/gocui/click.go +++ b/toolkit/gocui/click.go @@ -10,6 +10,36 @@ import ( "git.wit.org/wit/gui/toolkit" ) +func (w *cuiWidget) gridBounds() { + for a := 0; a < w.x; a++ { + for b := 0; b < w.y; b++ { + p := w.parent + log(logNow, "gridBounds() (w,h)", a, b, + "logical(W,H)", w.logicalW[a], w.logicalH[b], + "p.next(W,H)", p.nextW, p.nextH) + } + log("\n") + } + + for _, child := range w.children { + child.showWidgetPlacement(logNow, "gridBounds:") + var totalW, totalH int + for i, val := range w.logicalW { + if (i < child.parentW) { + log(logNow, "gridBounds() (w, logicalW[])", i, val) + totalW += w.logicalW[i] + } + } + for i, h := range w.logicalH { + if (i < child.parentH) { + totalH += h + } + } + log(logNow, "gridBounds()", child.id, "parent (W,H) =", child.parentW, child.parentH, + "total (W,H) =", totalW, totalH, child.name) + } +} + func (w *cuiWidget) doWidgetClick() { switch w.widgetType { case toolkit.Root: @@ -24,8 +54,9 @@ func (w *cuiWidget) doWidgetClick() { w.redoBox(true) w.toggleTree() case toolkit.Grid: - w.redoBox(true) - w.toggleTree() + w.gridBounds() + // w.redoBox(true) + // w.toggleTree() case toolkit.Box: // w.showWidgetPlacement(logNow, "drawTree()") if (w.horizontal) { |
