diff options
| author | Jeff Carr <[email protected]> | 2023-12-02 19:02:51 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-12-02 19:02:51 -0600 |
| commit | 7880d9df6de1040258bea966f040e12be6205af1 (patch) | |
| tree | bb0f3d74eb4e3b5094bfe78e936679efb940cacf /toolkit/gocui/globalDown.go | |
| parent | 19e6ea76f3c09fe3a5d9a4d4caff7d14571f4ba5 (diff) | |
gocui plugin refactor to a *node binary tree
rename arg '--gui <toolkit>'
add a cloudflare example
fixes since go v1.21 didn't compile anymore due to argv order
more place() changes
recursive size computation
gocui: Major refactor to use the *node binary tree
gocui: refactor place() and size()
gocui: better place() and spacing (tab, buttons, etc)
gocui: better mouse click handling
gocui: switch to using tk.gocuiSize & tk.size
gocui: event handling cleanups
gocui: add window labels work
gocui: struct cleanups
gocui: duplicate binary tree structs removed
gocui: deprecate old children
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/gocui/globalDown.go')
| -rw-r--r-- | toolkit/gocui/globalDown.go | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/toolkit/gocui/globalDown.go b/toolkit/gocui/globalDown.go deleted file mode 100644 index e9d6b13..0000000 --- a/toolkit/gocui/globalDown.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014 The gocui Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "errors" - "fmt" - - "github.com/awesome-gocui/gocui" -) - -func globalDown(g *gocui.Gui, v *gocui.View) error { - mx, my := g.MousePosition() - if vx0, vy0, vx1, vy1, err := g.ViewPosition("msg"); err == nil { - if mx >= vx0 && mx <= vx1 && my >= vy0 && my <= vy1 { - return msgDown(g, v) - } - } - globalMouseDown = true - maxX, _ := g.Size() - msg := fmt.Sprintf("Mouse really down at: %d,%d", mx, my) + "foo\n" + "bar\n" - x := mx - len(msg)/2 - if x < 0 { - x = 0 - } else if x+len(msg)+1 > maxX-1 { - x = maxX - 1 - len(msg) - 1 - } - if v, err := g.SetView("globalDown", x, my-1, x+len(msg)+1, my+1, 0); err != nil { - if !errors.Is(err, gocui.ErrUnknownView) { - return err - } - v.WriteString(msg) - } - return nil -} |
