summaryrefslogtreecommitdiff
path: root/toolkit/gocui/help.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-01 15:43:50 -0600
committerJeff Carr <[email protected]>2024-01-01 15:43:50 -0600
commit4e7bbd89900a733593f0848778103c1cf1a7145d (patch)
tree22cd22124dd3ecba7c2a866b882d39aaf790d670 /toolkit/gocui/help.go
parent53ce3a8252090d5fb75d7fc1e3cd75a72c1415c6 (diff)
reorg to final resting place at go.wit.com/gui/guiv0.9.5
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/gocui/help.go')
-rw-r--r--toolkit/gocui/help.go71
1 files changed, 0 insertions, 71 deletions
diff --git a/toolkit/gocui/help.go b/toolkit/gocui/help.go
deleted file mode 100644
index 82d5cc5..0000000
--- a/toolkit/gocui/help.go
+++ /dev/null
@@ -1,71 +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"
- "strings"
-
- "github.com/awesome-gocui/gocui"
-)
-
-var helpText []string = []string{"KEYBINDINGS",
- "",
- "?: toggle help",
- "d: toggle debugging",
- "r: redraw widgets",
- "s/h: show/hide all widgets",
- "L: list all widgets",
- "M: list all widgets positions",
- "q: quit()",
- "p: panic()",
- "o: show Stdout",
- "l: log to /tmp/witgui.log",
- "Ctrl-D: Toggle Debugging",
- "Ctrl-V: Toggle Verbose Debugging",
- "Ctrl-C: Exit",
- "",
-}
-
-func hidehelplayout() {
- me.baseGui.DeleteView("help")
- // n.deleteView()
- // child.hideFake()
-}
-
-func helplayout() error {
- g := me.baseGui
- var err error
- maxX, _ := g.Size()
-
- var newW int = 8
- for _, s := range(helpText) {
- if newW < len(s) {
- newW = len(s)
- }
- }
-
- help, err := g.SetView("help", maxX-(newW + me.FramePadW), 0, maxX-1, len(helpText) + me.FramePadH, 0)
- if err != nil {
- if !errors.Is(err, gocui.ErrUnknownView) {
- return err
- }
- help.SelBgColor = gocui.ColorGreen
- help.SelFgColor = gocui.ColorBlack
- // fmt.Fprintln(help, "Enter: Click Button")
- // fmt.Fprintln(help, "Tab/Space: Switch Buttons")
- // fmt.Fprintln(help, "Backspace: Delete Button")
- // fmt.Fprintln(help, "Arrow keys: Move Button")
-
- fmt.Fprintln(help, strings.Join(helpText, "\n"))
-
- if _, err := g.SetCurrentView("help"); err != nil {
- return err
- }
- }
- me.helpLabel = help
- return nil
-}