From f1eefc9a06880784269424bd5d8156ce7820b40d Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 5 Feb 2025 12:32:41 -0600 Subject: move code to better homes --- window.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'window.go') diff --git a/window.go b/window.go index 2f0673a..3a2cc13 100644 --- a/window.go +++ b/window.go @@ -13,8 +13,13 @@ func (tk *guiWidget) redrawWindow(w int, h int) { if tk.node.WidgetType != widget.Window { return } - tk.gocuiSize.w0 = w - 2 - tk.gocuiSize.h0 = h - 1 + // pin the window to (w,h) + tk.gocuiSize.w0 = w + tk.gocuiSize.h0 = h + tk.force.w0 = w + tk.force.w1 = w + tk.force.h0 = h + tk.force.h1 = h tk.setFullSize() // might make the green box the right size @@ -34,14 +39,12 @@ func (tk *guiWidget) redrawWindow(w int, h int) { // re-draws the buttons for each of the windows func redoWindows(nextW int, nextH int) { for _, win := range findWindows() { - win.gocuiSize.w0 = nextW - win.gocuiSize.h0 = nextH - win.dumpWidget(fmt.Sprintf("redoWindowsS (%d,%d)", nextW, nextH)) win.redrawWindow(nextW, nextH) win.dumpWidget(fmt.Sprintf("redoWindowsE (%d,%d)", nextW, nextH)) // increment the width for the next window - nextW += win.gocuiSize.Width() + 4 + nextW += 40 + nextH += 10 } } -- cgit v1.2.3