diff options
| author | Jeff Carr <[email protected]> | 2025-02-09 12:43:34 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-09 12:43:34 -0600 |
| commit | cf073e9aaefcb1f6ef7c254b53cc56d077e17efd (patch) | |
| tree | 3246a29c77c5b4266a0207ef8408339ed09a258c /eventMouseClick.go | |
| parent | 90a9f84f109800b820f5d15bad0b7ba146586edc (diff) | |
more mouse code cleanups
Diffstat (limited to 'eventMouseClick.go')
| -rw-r--r-- | eventMouseClick.go | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/eventMouseClick.go b/eventMouseClick.go index 54547af..b250858 100644 --- a/eventMouseClick.go +++ b/eventMouseClick.go @@ -4,8 +4,6 @@ package main import ( - "fmt" - "go.wit.com/log" "go.wit.com/widget" ) @@ -20,40 +18,6 @@ func (tk *guiWidget) doButtonClick() { } } -// 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) { - tk.dumpWidget(fmt.Sprintf("doWidgetClick(%d,%d)", w, h)) - switch tk.node.WidgetType { - case widget.Checkbox: - if tk.node.State.Checked { - log.Log(WARN, "checkbox is being set to false") - tk.node.State.Checked = false - tk.setCheckbox() - } else { - log.Log(WARN, "checkbox is being set to true") - tk.node.State.Checked = true - tk.setCheckbox() - } - me.myTree.SendUserEvent(tk.node) - case widget.Button: - tk.doButtonClick() - case widget.Combobox: - tk.showDropdown() - case widget.Dropdown: - tk.showDropdown() - case widget.Textbox: - tk.showTextbox() - case widget.Flag: - tk.dropdownClicked(w, h) - case widget.Stdout: - tk.dumpWidget("stdout click()") - default: - tk.dumpWidget("undef click()") - } -} - // handles a mouse click func doMouseClick(w int, h int) { // Flag widgets (dropdown menus, etc) are the highest priority. ALWAYS SEND MOUSE CLICKS THERE FIRST @@ -124,29 +88,6 @@ func doMouseClick(w int, h int) { // tk.dumpWidget("undef click()") // enable this to debug widget clicks } } - // log.Info("you clicked on a window, but not any widgets. check for title / close window here", win.cuiName) - // win.makeWindowActive() - // return - - var found bool - - for _, tk := range findByXY(w, h) { - // will show you everything found on a mouse click. great for debugging! - // tk.dumpWidget("click()") - if tk.node.WidgetType == widget.Stdout { - // don't send clicks to the stdout debugging window - // continue - } - found = true - // tk.doWidgetClick(w, h) - return - } - if found { - return - } - - log.Log(GOCUI, "click() nothing was at:", w, h) - return } func doMouseDoubleClick(w int, h int) { |
