diff options
| author | Jeff Carr <[email protected]> | 2023-03-29 22:44:08 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-03-29 22:44:08 -0500 |
| commit | 947169df5a22c9f9b53f825764747f648c70ff1e (patch) | |
| tree | 3c84fffc14352329bc41e6b58910ff278c99f08c /toolkit/democui/help.go | |
| parent | 6013fde8332e8ecbffaf1a0977ba2e1da8ea8775 (diff) | |
ready for version v0.7.4
start deprecating toolkit.Widget
switch to variable name 'ParentId'
use 'ActionType' and 'WidgetType'
preliminary redraw()
final definition of variables 'Name' and 'Text'
more cleaning of the code
remove lots of dumb code
bind 'd' key press to dump out debugging info
early color handling in gocui!
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/democui/help.go')
| -rw-r--r-- | toolkit/democui/help.go | 32 |
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 } |
