// Copyright 2017-2025 WIT.COM Inc. All rights reserved. // Use of this source code is governed by the GPL 3.0 package main import ( "fmt" "go.wit.com/widget" ) 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 tk.setFullSize() // might make the green box the right size tk.frame = false tk.hasTabs = false tk.DrawAt(w, h) tk.setColor(&colorActiveW) // sets the window to Green BG tk.placeWidgets(w, h) // compute the sizes & places for each widget tk.setFullSize() me.baseGui.SetView(tk.cuiName, tk.gocuiSize.w0, tk.gocuiSize.h0, tk.gocuiSize.w1, tk.gocuiSize.h1, 0) tk.Show() tk.showWidgets() } // 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 } }