diff options
Diffstat (limited to 'eventBindings.go')
| -rw-r--r-- | eventBindings.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/eventBindings.go b/eventBindings.go index 5c0a599..330c255 100644 --- a/eventBindings.go +++ b/eventBindings.go @@ -9,6 +9,7 @@ import ( "github.com/awesome-gocui/gocui" "go.wit.com/log" + "go.wit.com/widget" ) // THIS IS A STANDARD. @@ -44,6 +45,7 @@ func registerHandlers(g *gocui.Gui) { g.SetKeybinding("", 'M', gocui.ModNone, dumpWidgetPlacement) // 'M' list all widgets with positions g.SetKeybinding("", 'L', gocui.ModNone, dumpWidgets) // 'L' list all widgets in tree view g.SetKeybinding("", 'd', gocui.ModNone, theLetterD) // 'd' toggles on and off debugging buttons + g.SetKeybinding("", '2', gocui.ModNone, theNotsure) // '2' for testing new ideas g.SetKeybinding("", 'q', gocui.ModNone, quit) // 'q' only exits gocui. plugin stays alive (?) } @@ -60,6 +62,21 @@ func setSuperMouse(g *gocui.Gui, v *gocui.View) error { return nil } +// use this to test code ideas +func theNotsure(g *gocui.Gui, v *gocui.View) error { + log.Info("got keypress 2. now what?") + w, h := g.MousePosition() + for _, tk := range findByXY(w, h) { + if tk.WidgetType == widget.Stdout { + log.Info("skipping stdout") + continue + } + log.Log(GOCUI, fmt.Sprintf("findByXY() 'f' key %-8s wId=%4d at (%3d,%3d) %s", tk.WidgetType, tk.node.WidgetId, w, h, tk.node.String())) + tk.Hide() + } + return nil +} + func theHide(g *gocui.Gui, v *gocui.View) error { var w *guiWidget w = me.treeRoot.TK.(*guiWidget) |
