summaryrefslogtreecommitdiff
path: root/toolkit/democui/help.go
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/democui/help.go')
-rw-r--r--toolkit/democui/help.go32
1 files changed, 19 insertions, 13 deletions
diff --git a/toolkit/democui/help.go b/toolkit/democui/help.go
index ce88b92..f012fef 100644
--- a/toolkit/democui/help.go
+++ b/toolkit/democui/help.go
@@ -12,29 +12,35 @@ import (
)
func addHelp() {
- baseGui.SetManagerFunc(helplayout)
+ me.baseGui.SetManagerFunc(helplayout)
}
func helplayout(g *gocui.Gui) error {
var err error
maxX, _ := g.Size()
- helpLabel, err = g.SetView("help", maxX-32, 0, maxX-1, 12, 0)
+ help, err := g.SetView("help", maxX-32, 0, maxX-1, 12, 0)
if err != nil {
if !errors.Is(err, gocui.ErrUnknownView) {
return err
}
- fmt.Fprintln(helpLabel, "KEYBINDINGS")
- fmt.Fprintln(helpLabel, "Enter: Click Button")
- fmt.Fprintln(helpLabel, "Tab/Space: Switch Buttons")
- fmt.Fprintln(helpLabel, "")
- fmt.Fprintln(helpLabel, "h: Help")
- fmt.Fprintln(helpLabel, "Backspace: Delete Button")
- fmt.Fprintln(helpLabel, "Arrow keys: Move Button")
- fmt.Fprintln(helpLabel, "t: Move Button to the top")
- fmt.Fprintln(helpLabel, "b: Move Button to the button")
- fmt.Fprintln(helpLabel, "STDOUT: /tmp/witgui.log")
- fmt.Fprintln(helpLabel, "Ctrl-C or Q: Exit")
+ help.SelBgColor = gocui.ColorGreen
+ help.SelFgColor = gocui.ColorBlack
+ fmt.Fprintln(help, "KEYBINDINGS")
+ fmt.Fprintln(help, "Enter: Click Button")
+ fmt.Fprintln(help, "Tab/Space: Switch Buttons")
+ fmt.Fprintln(help, "")
+ fmt.Fprintln(help, "h: Help")
+ fmt.Fprintln(help, "Backspace: Delete Button")
+ fmt.Fprintln(help, "Arrow keys: Move Button")
+ fmt.Fprintln(help, "t: Move Button to the top")
+ fmt.Fprintln(help, "b: Move Button to the button")
+ fmt.Fprintln(help, "STDOUT: /tmp/witgui.log")
+ fmt.Fprintln(help, "Ctrl-C or Q: Exit")
+ if _, err := g.SetCurrentView("help"); err != nil {
+ return err
+ }
}
+ me.helpLabel = help
return nil
}