gocui/window.go

46 lines
1010 B
Go
Raw Normal View History

2025-02-01 11:42:31 -06:00
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
import (
2025-02-04 13:31:48 -06:00
"fmt"
"go.wit.com/widget"
)
// re-draws the buttons for each of the windows
2025-02-04 13:31:48 -06:00
func (tk *guiWidget) redoWindows(nextW int, nextH int) {
2025-02-04 13:31:48 -06:00
for _, child := range tk.children {
if child.node.WidgetType != widget.Window {
continue
}
2025-02-04 13:31:48 -06:00
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
2025-02-04 09:40:51 -06:00
// this should make the window the full size and re-draw it
child.setFullSize() // child.gocuiSetWH(nextW, nextH)
child.Hide()
2025-02-04 13:31:48 -06:00
child.DrawAt(nextW, nextH)
child.Show()
tmp = fmt.Sprintf("redoWindowsE (%d,%d)", nextW, nextH)
child.dumpWidget(tmp)
2025-02-04 09:40:51 -06:00
2025-02-04 13:31:48 -06:00
nextW += child.gocuiSize.Width() + 4
child.redoWindows(nextW, nextH)
/*
sizeW := child.gocuiSize.Width()
nextW += sizeW + 4
child.redoWindows(startW+3, startH+2)
*/
}
}