gocui/window.go

46 lines
1010 B
Go

// 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"
)
// re-draws the buttons for each of the windows
func (tk *guiWidget) redoWindows(nextW int, nextH int) {
for _, child := range tk.children {
if child.node.WidgetType != widget.Window {
continue
}
child.gocuiSize.w0 = nextW
child.gocuiSize.h0 = nextH
tmp := fmt.Sprintf("redoWindowsS (%d,%d)", nextW, nextH)
child.dumpWidget(tmp)
child.frame = false
child.hasTabs = false
// this should make the window the full size and re-draw it
child.setFullSize() // child.gocuiSetWH(nextW, nextH)
child.Hide()
child.DrawAt(nextW, nextH)
child.Show()
tmp = fmt.Sprintf("redoWindowsE (%d,%d)", nextW, nextH)
child.dumpWidget(tmp)
nextW += child.gocuiSize.Width() + 4
child.redoWindows(nextW, nextH)
/*
sizeW := child.gocuiSize.Width()
nextW += sizeW + 4
child.redoWindows(startW+3, startH+2)
*/
}
}