From 947169df5a22c9f9b53f825764747f648c70ff1e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 29 Mar 2023 22:44:08 -0500 Subject: 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 --- toolkit/democui/help.go | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'toolkit/democui/help.go') 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 } -- cgit v1.2.3