diff options
| author | Jeff Carr <[email protected]> | 2023-03-26 17:19:20 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-03-26 17:19:20 -0500 |
| commit | 6013fde8332e8ecbffaf1a0977ba2e1da8ea8775 (patch) | |
| tree | 3f9ccd75e8699974f3412fdd79a20173672c19c2 /toolkit/democui/help.go | |
| parent | 6f91f5e080e06cdc0f34b13d23e5fd16ea37259a (diff) | |
improvements towards a working dns control panel
democui has the help menu
try to add mouse support to gocui
make a direct access method
Margin() and Pad() tests
add SPEW
also push devel branch to github
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/democui/help.go')
| -rw-r--r-- | toolkit/democui/help.go | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/toolkit/democui/help.go b/toolkit/democui/help.go new file mode 100644 index 0000000..ce88b92 --- /dev/null +++ b/toolkit/democui/help.go @@ -0,0 +1,40 @@ +// 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" + + "github.com/awesome-gocui/gocui" +) + +func addHelp() { + 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) + 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") + } + return nil +} |
