summaryrefslogtreecommitdiff
path: root/window.go
diff options
context:
space:
mode:
Diffstat (limited to 'window.go')
-rw-r--r--window.go50
1 files changed, 28 insertions, 22 deletions
diff --git a/window.go b/window.go
index ed9debe..130c688 100644
--- a/window.go
+++ b/window.go
@@ -9,37 +9,43 @@ import (
"go.wit.com/widget"
)
+func (tk *guiWidget) redrawWindow(w int, h int) {
+ if tk.node.WidgetType != widget.Window {
+ return
+ }
+ tk.setFullSize() // might make the green box the right size
+
+ 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.showWidgets()
+
+ tk.setFullSize()
+ me.baseGui.SetView(tk.cuiName, tk.gocuiSize.w0, tk.gocuiSize.h0, tk.gocuiSize.w1, tk.gocuiSize.h1, 0)
+}
+
// 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
+ for _, win := range findWindows() {
+ win.gocuiSize.w0 = nextW
+ win.gocuiSize.h0 = nextH
tmp := fmt.Sprintf("redoWindowsS (%d,%d)", nextW, nextH)
- child.dumpWidget(tmp)
+ win.dumpWidget(tmp)
- child.frame = false
- child.hasTabs = false
+ win.frame = false
+ win.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()
+ win.setFullSize() // win.gocuiSetWH(nextW, nextH)
+ win.Hide()
+ win.DrawAt(nextW, nextH)
+ win.Show()
tmp = fmt.Sprintf("redoWindowsE (%d,%d)", nextW, nextH)
- child.dumpWidget(tmp)
+ win.dumpWidget(tmp)
- nextW += child.gocuiSize.Width() + 4
- child.redoWindows(nextW, nextH)
- /*
- sizeW := child.gocuiSize.Width()
- nextW += sizeW + 4
- child.redoWindows(startW+3, startH+2)
- */
+ // increment the width for the next window
+ nextW += win.gocuiSize.Width() + 4
}
}