summaryrefslogtreecommitdiff
path: root/eventMouse.go
diff options
context:
space:
mode:
Diffstat (limited to 'eventMouse.go')
-rw-r--r--eventMouse.go68
1 files changed, 37 insertions, 31 deletions
diff --git a/eventMouse.go b/eventMouse.go
index 05880a8..935f2b5 100644
--- a/eventMouse.go
+++ b/eventMouse.go
@@ -110,41 +110,47 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error {
log.Info("never found textbox at", w, h)
return nil
}
-
// figre out what window this is
- tk := findWindowUnderMouse()
- if tk == nil {
+ win := findWindowUnderMouse()
+ if win == nil {
log.Info("mouseDown() nothing to click on at", w, h)
return nil
}
- tk.makeWindowActive()
- // log.Info("SENDING mouseDown() to findWindowUnderMouse()")
- if tk.node.WidgetType == widget.Window {
- // check to see if this is a direct click on a widget
- for _, tk := range tk.findByXYreal(w, h) {
- // tk.dumpWidget("mouseDown()")
- if tk.node.WidgetType == widget.Button {
- // log.Info("SENDING CLICK TO Button")
- tk.doWidgetClick(w, h)
- return nil
- }
- if tk.node.WidgetType == widget.Checkbox {
- // log.Info("SENDING CLICK TO Checkbox")
- tk.doWidgetClick(w, h)
- return nil
- }
- if tk.node.WidgetType == widget.Dropdown {
- // log.Info("SENDING CLICK TO Dropdown")
- tk.doWidgetClick(w, h)
- return nil
- }
- if tk.node.WidgetType == widget.Textbox {
- // log.Info("SENDING CLICK TO Textbox")
- tk.doWidgetClick(w, h)
- return nil
+ return nil
+ // me.mouse.currentDrag = tk
+
+ /*
+ if !tk.isWindowActive() {
+ tk.makeWindowActive()
+ return nil
+ }
+
+ // log.Info("SENDING mouseDown() to findWindowUnderMouse()")
+ if tk.node.WidgetType == widget.Window {
+ // check to see if this is a direct click on a widget
+ for _, tk := range tk.findByXYreal(w, h) {
+ // tk.dumpWidget("mouseDown()")
+ if tk.node.WidgetType == widget.Button {
+ // log.Info("SENDING CLICK TO Button")
+ tk.doWidgetClick(w, h)
+ return nil
+ }
+ if tk.node.WidgetType == widget.Checkbox {
+ // log.Info("SENDING CLICK TO Checkbox")
+ tk.doWidgetClick(w, h)
+ return nil
+ }
+ if tk.node.WidgetType == widget.Dropdown {
+ // log.Info("SENDING CLICK TO Dropdown")
+ tk.doWidgetClick(w, h)
+ return nil
+ }
+ if tk.node.WidgetType == widget.Textbox {
+ // log.Info("SENDING CLICK TO Textbox")
+ tk.doWidgetClick(w, h)
+ return nil
+ }
}
}
- }
- me.mouse.currentDrag = tk
- return nil
+ */
}