diff options
Diffstat (limited to 'window.go')
| -rw-r--r-- | window.go | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -17,6 +17,7 @@ func (tk *guiWidget) redrawWindow(w int, h int) { // pin the window to (w,h) tk.gocuiSize.w0 = w tk.gocuiSize.h0 = h + tk.gocuiSize.w1 = w + len(tk.GetText()) tk.force.w0 = w tk.force.w1 = w tk.force.h0 = h @@ -40,12 +41,15 @@ func (tk *guiWidget) redrawWindow(w int, h int) { tk.Show() tk.showWidgets() + // RE-VERIFY THIS CAN'T BE DONE IN A BETTER WAY. However, for now, this works finally so I am leaving it alone + if tk.windowFrame == nil { tk.addWindowFrameTK(0 - tk.node.WidgetId) tk.windowFrame.node.State.Label = "windowFrame" tk.windowFrame.makeTK([]string{"windowFrame"}) } - // tk.windowFrame.MoveToOffset(w, h+2) + + // this seems to correctly create the window frame r := tk.getFullSize() tk.windowFrame.gocuiSize.w0 = tk.force.w0 tk.windowFrame.gocuiSize.w1 = r.w1 + 1 @@ -55,14 +59,17 @@ func (tk *guiWidget) redrawWindow(w int, h int) { tk.windowFrame.full.w1 = r.w1 + 1 tk.windowFrame.full.h0 = tk.force.h0 + 2 tk.windowFrame.full.h1 = r.h1 + 1 - // tk.windowFrame.drawView() tk.windowFrame.Hide() tk.windowFrame.Show() + + // set the window frame below the window widget, but this resizes the window widget it seems me.baseGui.SetViewBeneath(tk.windowFrame.cuiName, tk.cuiName, 1) + // so now we have to resize the window frame, but this moves it to the top? me.baseGui.SetView(tk.windowFrame.cuiName, tk.windowFrame.full.w0, tk.windowFrame.full.h0, tk.windowFrame.full.w1, tk.windowFrame.full.h1, 0) + + // so we have to redraw the widgets in the window anyway and then they will appear above he frame tk.hideWidgets() tk.showWidgets() - // tk.windowFrame.drawView() } // re-draws the buttons for each of the windows |
