summaryrefslogtreecommitdiff
path: root/eventMouseClick.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-04 10:04:45 -0600
committerJeff Carr <[email protected]>2025-02-04 10:04:45 -0600
commitacfb80a2e702a7472ccf547350c2a71568c8cf01 (patch)
treeb93e63994d8b8132cb18e7ffc40a034a1880d904 /eventMouseClick.go
parenta10582c84636ef378b91d98243043f099aff1a87 (diff)
kinda, sorta, but no. not yet
Diffstat (limited to 'eventMouseClick.go')
-rw-r--r--eventMouseClick.go36
1 files changed, 23 insertions, 13 deletions
diff --git a/eventMouseClick.go b/eventMouseClick.go
index 1f33ee7..81b8aaf 100644
--- a/eventMouseClick.go
+++ b/eventMouseClick.go
@@ -9,6 +9,27 @@ import (
"go.wit.com/widget"
)
+func (tk *guiWidget) redrawWindow(w int, h int) {
+ if tk.node.WidgetType != widget.Window {
+ return
+ }
+ // might make the green box the right size
+ tk.setFullSize()
+
+ // draw the current window
+ // w = tk.gocuiSize.w0 + 4
+ // h = tk.gocuiSize.h0 + 4
+ w = w + 4
+ h = h + 4
+ tk.DrawAt(w, h)
+ tk.setColor(&colorActiveW) // sets the window to Green BG
+ tk.showWidgets()
+ tk.placeWidgets(w, h) // compute the sizes & places for each widget
+
+ tk.setFullSize()
+ me.baseGui.SetView(tk.cuiName, tk.gocuiSize.w0, tk.gocuiSize.h0, tk.gocuiSize.w1, tk.gocuiSize.h1, 0)
+}
+
// 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
@@ -27,19 +48,8 @@ func (tk *guiWidget) doWidgetClick(w int, h int) {
me.currentWindow.isCurrent = true
tk.active = false
- // might make the green box the right size
- tk.setFullSize()
-
- // draw the current window
- w := tk.gocuiSize.w0 + 4
- h := tk.gocuiSize.h0 + 4
- tk.DrawAt(w, h)
- tk.setColor(&colorActiveW) // sets the window to Green BG
- tk.showWidgets()
- tk.placeWidgets(w, h) // compute the sizes & places for each widget
-
- tk.setFullSize()
- me.baseGui.SetView(tk.cuiName, tk.gocuiSize.w0, tk.gocuiSize.h0, tk.gocuiSize.w1, tk.gocuiSize.h1, 0)
+ tk.redrawWindow(tk.gocuiSize.w0, tk.gocuiSize.h0)
+ return
case widget.Group:
if tk.active {
tk.active = false