diff options
Diffstat (limited to 'window.go')
| -rw-r--r-- | window.go | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -115,8 +115,7 @@ func redoWindows(nextW int, nextH int) { // tk.dumpWidget(fmt.Sprintf("redoWindowsS (%d,%d)", nextW, nextH)) if tk.window.wasDragged { // don't move windows around the user has dragged to a certain location - tk.redrawWindow(tk.gocuiSize.w0, tk.gocuiSize.h0) - setThingsOnTop() // sets help, Stdout, etc on the top after windows have been redrawn + tk.makeWindowActive() } else { w, _ := me.baseGui.Size() if nextW > w-20 { @@ -175,12 +174,27 @@ func (win *guiWidget) addWindowFrame(wId int) *tree.Node { return n } +func (tk *guiWidget) isWindowActive() bool { + if !(tk.node.WidgetType == widget.Window || tk.node.WidgetType == widget.Stdout) { + // only allow Window or the Stdout widgets to be made active + return false + } + return tk.window.active +} + +// always redraws at the corner of the gocuiSize box func (tk *guiWidget) makeWindowActive() { if !(tk.node.WidgetType == widget.Window || tk.node.WidgetType == widget.Stdout) { // only allow Window or the Stdout widgets to be made active return } + if tk.node.WidgetType == widget.Stdout { + me.stdout.outputOnTop = true + } else { + // me.stdout.outputOnTop = false // ? + } + // disable and increment all the windows for _, tk := range me.allwin { tk.window.order += 1 @@ -193,6 +207,9 @@ func (tk *guiWidget) makeWindowActive() { tk.window.active = true tk.window.order = 0 + tk.redrawWindow(tk.gocuiSize.w0, tk.gocuiSize.h0) + setThingsOnTop() // sets help, Stdout, etc on the top after windows have been redrawn + /* // print out the window list for _, tk := range me.allwin { |
