From c136ca2b4c33ae639af0f62f604ecdf73ea38d3e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 6 Feb 2025 07:01:27 -0600 Subject: tab rotates through the windows --- eventMouseClick.go | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'eventMouseClick.go') diff --git a/eventMouseClick.go b/eventMouseClick.go index aa8be6e..5990f27 100644 --- a/eventMouseClick.go +++ b/eventMouseClick.go @@ -9,25 +9,30 @@ import ( "go.wit.com/widget" ) +func (tk *guiWidget) doWindowClick(w int, h int) { + // if there is a current window, hide it + if me.currentWindow != nil { + me.currentWindow.setColor(&colorWindow) + // me.currentWindow.hideWidgets() + me.currentWindow.isCurrent = false + } + + // now set this window as the current window + me.currentWindow = tk + me.currentWindow.isCurrent = true + tk.active = false + + tk.redrawWindow(w, h) + setThingsOnTop() // sets help, Stdout, etc on the top after windows have been redrawn +} + // this whole things was impossible to make but it got me where I am now // the debugging is way way better now with it being visible in the Stdout window // so now it's possible to redo all this and make it better func (tk *guiWidget) doWidgetClick(w int, h int) { switch tk.node.WidgetType { case widget.Window: - // if there is a current window, hide it - if me.currentWindow != nil { - me.currentWindow.setColor(&colorWindow) - // me.currentWindow.hideWidgets() - me.currentWindow.isCurrent = false - } - - // now set this window as the current window - me.currentWindow = tk - me.currentWindow.isCurrent = true - tk.active = false - - tk.redrawWindow(w-2, h-2) // TODO: fix these hard coded things with offsets + tk.doWindowClick(w, h) return case widget.Group: /* -- cgit v1.2.3