diff options
Diffstat (limited to 'eventBindings.go')
| -rw-r--r-- | eventBindings.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/eventBindings.go b/eventBindings.go index 93663b6..5eda90b 100644 --- a/eventBindings.go +++ b/eventBindings.go @@ -61,9 +61,33 @@ func setSuperMouse(g *gocui.Gui, v *gocui.View) error { return nil } +var wtf bool + // use this to test code ideas func theNotsure(g *gocui.Gui, v *gocui.View) error { log.Info("got keypress 2. now what?") + // closes anything under your mouse + w, h := g.MousePosition() + for _, tk := range findByXY(w, h) { + if tk.node.WidgetType == widget.Stdout { + tk.dumpWidget("theNotsure() DrawAt STDOUT") + tk.DrawAt(10, 10) + if wtf { + log.Log(GOCUI, "set visible false") + tk.deleteView() + // tk.SetVisible(false) + wtf = false + } else { + log.Log(GOCUI, "set visible true") + tk.drawView() + // tk.SetVisible(true) + wtf = true + } + continue + } + } + + /* closes anything under your mouse w, h := g.MousePosition() for _, tk := range findByXY(w, h) { if tk.node.WidgetType == widget.Stdout { @@ -73,6 +97,7 @@ func theNotsure(g *gocui.Gui, v *gocui.View) error { tk.dumpWidget("theNotsure() HIDDING") tk.Hide() } + */ return nil } |
