summaryrefslogtreecommitdiff
path: root/window.go
blob: ed9debe694a45df07a9374b669683c6b96ec0e75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// 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)
		*/
	}
}