summaryrefslogtreecommitdiff
path: root/stdin.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-27 12:55:27 -0600
committerJeff Carr <[email protected]>2024-01-27 12:55:27 -0600
commit267c941790e4c42ac207322a8d4fdc011fc8ee10 (patch)
tree79ddd7104799815d3397f9c38d9aba552cdcd779 /stdin.go
parent4445695b68d43ed9ddb679ca105b407a725ed54a (diff)
clearer STDOUT interfacev0.13.18
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'stdin.go')
-rw-r--r--stdin.go22
1 files changed, 15 insertions, 7 deletions
diff --git a/stdin.go b/stdin.go
index b86802a..a8897f5 100644
--- a/stdin.go
+++ b/stdin.go
@@ -12,6 +12,19 @@ import (
"go.wit.com/widget"
)
+func showOptions() {
+ fmt.Println("")
+ fmt.Println("Enter:")
+ fmt.Println("'l': list all widgets")
+ fmt.Println("'b': for buttons")
+ fmt.Println("'g': load gocui plugin")
+ fmt.Println("'a': load andlabs plugin")
+ fmt.Println("'d': enable debugging")
+ fmt.Println("")
+ fmt.Println("Enter the number of the widget to click:")
+ fmt.Print("Option: ")
+}
+
func simpleStdin() {
defer func() {
if r := recover(); r != nil {
@@ -41,13 +54,7 @@ func simpleStdin() {
case "d":
me.myTree.SendEnableDebugger()
case "":
- fmt.Println("")
- fmt.Println("Enter:")
- fmt.Println("'l': list all widgets")
- fmt.Println("'b': for buttons")
- fmt.Println("'g': load gocui plugin")
- fmt.Println("'a': load andlabs plugin")
- fmt.Println("'d': enable debugging")
+ showOptions()
default:
i, _ := strconv.Atoi(s)
log.Log(NOW, "got input:", i)
@@ -71,5 +78,6 @@ func simpleStdin() {
}
}
}
+ showOptions()
}
}