diff options
| author | Jeff Carr <[email protected]> | 2025-02-01 18:05:39 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-01 18:05:39 -0600 |
| commit | f79cf8917058b421a4f8dd4a854795720671c008 (patch) | |
| tree | cff72d250ab618f791fc87291c19232a8bc7fd1a | |
| parent | 5a2097d08053cbfc0d4c05fb7fec72d43ea7e5eb (diff) | |
part way to a generalized mouse move()
| -rw-r--r-- | eventMouse.go | 12 | ||||
| -rw-r--r-- | eventMouseMove.go | 18 | ||||
| -rw-r--r-- | help.go | 2 | ||||
| -rw-r--r-- | structs.go | 1 |
4 files changed, 1 insertions, 32 deletions
diff --git a/eventMouse.go b/eventMouse.go index b14bd7e..63e0165 100644 --- a/eventMouse.go +++ b/eventMouse.go @@ -23,10 +23,6 @@ func msgDown(g *gocui.Gui, v *gocui.View) error { tk.dumpWidget("mouseDown()") } - // debugging output - // log.Log(GOCUI, "msgDown() X,Y", initialMouseX, initialMouseY) - - // vx, vy, _, _, err := g.ViewPosition("msg") if err == nil { xOffset = initialMouseX - vx @@ -50,12 +46,6 @@ func mouseUp(g *gocui.Gui, v *gocui.View) error { if msgMouseDown { msgMouseDown = false - if me.movingMsg { - me.movingMsg = false - return nil - } else { - g.DeleteView("msg") - } } else if globalMouseDown { globalMouseDown = false g.DeleteView("globalDown") @@ -63,8 +53,6 @@ func mouseUp(g *gocui.Gui, v *gocui.View) error { return nil } -// func isMouseInMsg - // this is where you have to figure out what // widget was underneath so you can active // the right response for the toolkit user's app diff --git a/eventMouseMove.go b/eventMouseMove.go index d67c3c3..a88f64c 100644 --- a/eventMouseMove.go +++ b/eventMouseMove.go @@ -59,29 +59,11 @@ func mouseMove(g *gocui.Gui) { // this is how the window gets dragged around func (tk *guiWidget) moveNew(g *gocui.Gui) { mx, my := g.MousePosition() - if !me.movingMsg && (mx != initialMouseX || my != initialMouseY) { - me.movingMsg = true - } - // tk.DrawAt(mx-xOffset, my-yOffset) - g.SetView("msg", mx-xOffset, my-yOffset, mx-xOffset+outputW, my-yOffset+outputH+me.FramePadH, 0) - me.startOutputW = mx - xOffset - me.startOutputH = my - yOffset - g.SetViewOnBottom("msg") -} - -/* -// this is how the window gets dragged around -func moveMsg(g *gocui.Gui) { - mx, my := g.MousePosition() - if !me.movingMsg && (mx != initialMouseX || my != initialMouseY) { - me.movingMsg = true - } g.SetView("msg", mx-xOffset, my-yOffset, mx-xOffset+outputW, my-yOffset+outputH+me.FramePadH, 0) me.startOutputW = mx - xOffset me.startOutputH = my - yOffset g.SetViewOnBottom("msg") } -*/ func createStdout(g *gocui.Gui) bool { if widgetView, _ := g.View("msg"); widgetView == nil { @@ -24,7 +24,7 @@ import ( var helpText []string = []string{"KEYBINDINGS", "", - "?: toggle help", + "?: toggle zhelp", "S: super mouse", "M: list all widgets positions", "L: list all widgets in tree form", @@ -70,7 +70,6 @@ type config struct { ecount int // counts how many mouse and keyboard events have occurred supermouse bool // prints out every widget found while you move the mouse around depth int // used for listWidgets() debugging - movingMsg bool // means the user id dragging something around with the mouse } // deprecate these |
