summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eventBindings.go16
-rw-r--r--help.go17
-rw-r--r--treeAdd.go2
3 files changed, 21 insertions, 14 deletions
diff --git a/eventBindings.go b/eventBindings.go
index 6cdd2ed..6d2c613 100644
--- a/eventBindings.go
+++ b/eventBindings.go
@@ -188,19 +188,11 @@ func theLetterD(g *gocui.Gui, v *gocui.View) error {
func theHelp(g *gocui.Gui, v *gocui.View) error {
if me.showHelp {
- helplayout()
- me.showHelp = false
- /*
- if me.dropdownV == nil {
- log.Info("FIXME: MADE me.dropdownV AGAIN")
- me.dropdownV = makeDropdownView("addWidget() ddview help")
- }
- */
- // me.dropdownV.Show()
+ log.Info("Show the help!")
+ showHelp()
} else {
- me.baseGui.DeleteView("help")
- me.showHelp = true
- // me.dropdownV.Hide()
+ log.Info("Hide the help!")
+ hideHelp()
}
return nil
}
diff --git a/help.go b/help.go
index 12e8c9b..6342a5e 100644
--- a/help.go
+++ b/help.go
@@ -13,6 +13,7 @@ import (
"strings"
"github.com/awesome-gocui/gocui"
+ log "go.wit.com/log"
)
/*
@@ -41,11 +42,23 @@ var helpText []string = []string{"KEYBINDINGS",
"",
}
-func hidehelplayout() {
+func hideHelp() {
+ if me.showHelp {
+ log.Info("help is already down")
+ me.showHelp = true
+ return
+ }
+ me.showHelp = true
me.baseGui.DeleteView("help")
}
-func helplayout() error {
+func showHelp() error {
+ if !me.showHelp {
+ log.Info("help is already up")
+ me.showHelp = false
+ return nil
+ }
+ me.showHelp = false
g := me.baseGui
var err error
maxX, _ := g.Size()
diff --git a/treeAdd.go b/treeAdd.go
index 3bd4939..d62e89b 100644
--- a/treeAdd.go
+++ b/treeAdd.go
@@ -55,6 +55,8 @@ func addWidget(n *tree.Node) {
// if me.dropdownV == nil {
// me.dropdownV = makeDropdownView("addWidget() ddview2")
// }
+ hideHelp()
+ showHelp()
return
case widget.Tab:
nw.color = &colorTab