summaryrefslogtreecommitdiff
path: root/toolkit/democui/keybindings.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-03 10:26:47 -0500
committerJeff Carr <[email protected]>2023-04-03 10:26:47 -0500
commit4b6207743b90968d6b822032a4355e43b6ce6da9 (patch)
tree2cb9f13d5e95f14e165f8e41e8484320b7454177 /toolkit/democui/keybindings.go
parent0320ebe4bb49ea80761d77af80fa208157ffdb89 (diff)
gocui: working towards correct layout
make a gocui widget binary tree more debugging cleanups sample button app displays in gocui geometry logic closer to correct improvements in gocui layout continued attempts to clean up tabs dump binary tree moving towards proper chan callback() deprecate Widget.Name Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/democui/keybindings.go')
-rw-r--r--toolkit/democui/keybindings.go62
1 files changed, 0 insertions, 62 deletions
diff --git a/toolkit/democui/keybindings.go b/toolkit/democui/keybindings.go
deleted file mode 100644
index 977a375..0000000
--- a/toolkit/democui/keybindings.go
+++ /dev/null
@@ -1,62 +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 (
- "github.com/awesome-gocui/gocui"
-)
-
-func defaultKeybindings(g *gocui.Gui) error {
- if err := g.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, quit); err != nil {
- return err
- }
- for _, n := range []string{"but1", "but2", "help", "but3"} {
- if err := g.SetKeybinding(n, gocui.MouseLeft, gocui.ModNone, showMsg); err != nil {
- return err
- }
- }
- if err := g.SetKeybinding("", gocui.MouseRelease, gocui.ModNone, mouseUp); err != nil {
- return err
- }
- if err := g.SetKeybinding("", gocui.MouseLeft, gocui.ModNone, globalDown); err != nil {
- return err
- }
- if err := g.SetKeybinding("msg", gocui.MouseLeft, gocui.ModNone, msgDown); err != nil {
- return err
- }
- addDebugKeys(g)
- return nil
-}
-
-// dump out the widgets
-func addDebugKeys(g *gocui.Gui) {
- // dump all widget info to the log
- g.SetKeybinding("", 'd', gocui.ModNone,
- func(g *gocui.Gui, v *gocui.View) error {
- dumpWidgets(g, v)
- return nil
- })
-
- // hide all widgets
- g.SetKeybinding("", 'h', gocui.ModNone,
- func(g *gocui.Gui, v *gocui.View) error {
- hideWidgets()
- return nil
- })
-
- // show all widgets
- g.SetKeybinding("", 's', gocui.ModNone,
- func(g *gocui.Gui, v *gocui.View) error {
- showWidgets()
- return nil
- })
-
- // try to adjust all the widget positions
- g.SetKeybinding("", 'r', gocui.ModNone,
- func(g *gocui.Gui, v *gocui.View) error {
- adjustWidgets()
- return nil
- })
-}