summaryrefslogtreecommitdiff
path: root/toolkit/gocui
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-08 08:40:31 -0500
committerJeff Carr <[email protected]>2023-04-08 08:40:31 -0500
commit5d2f6e7fb241298eb15b1917c1947089a12247fe (patch)
tree0f67fc7c2955b40904a3ac4600cf82f53938398b /toolkit/gocui
parent0f3074ab5d606822ae0d170da84507d6e24471e6 (diff)
gocui: keep deprecating non-gochannel code
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/gocui')
-rw-r--r--toolkit/gocui/add.go2
-rw-r--r--toolkit/gocui/debug.go2
-rw-r--r--toolkit/gocui/log.go6
-rw-r--r--toolkit/gocui/main.go2
-rw-r--r--toolkit/gocui/plugin.go14
5 files changed, 12 insertions, 14 deletions
diff --git a/toolkit/gocui/add.go b/toolkit/gocui/add.go
index e207b9f..64dbdd5 100644
--- a/toolkit/gocui/add.go
+++ b/toolkit/gocui/add.go
@@ -25,7 +25,7 @@ func (w *cuiWidget) setFake() {
fakeStartWidth += 20
}
w.setWH()
- if (debugAction) {
+ if (logInfo) {
w.drawView()
}
}
diff --git a/toolkit/gocui/debug.go b/toolkit/gocui/debug.go
index d8bfd6e..e569872 100644
--- a/toolkit/gocui/debug.go
+++ b/toolkit/gocui/debug.go
@@ -7,7 +7,7 @@ import (
// "github.com/awesome-gocui/gocui"
)
-var debugAction bool = false
+// var debugAction bool = false
func actionDump(b bool, a *toolkit.Action) {
if (a == nil) {
diff --git a/toolkit/gocui/log.go b/toolkit/gocui/log.go
index 222332d..44bcf6c 100644
--- a/toolkit/gocui/log.go
+++ b/toolkit/gocui/log.go
@@ -8,9 +8,9 @@ import (
// various debugging flags
var logNow bool = true // useful for active development
var logError bool = true
-var logWarn bool = false
-var logInfo bool = false
-var logVerbose bool = false
+var logWarn bool = true
+var logInfo bool = true
+var logVerbose bool = true
func log(a ...any) {
witlog.Where = "wit/gocui"
diff --git a/toolkit/gocui/main.go b/toolkit/gocui/main.go
index 4dd7112..ed9670a 100644
--- a/toolkit/gocui/main.go
+++ b/toolkit/gocui/main.go
@@ -49,7 +49,7 @@ func catchActionChannel() {
select {
case a := <-me.pluginChan:
log(logNow, "makeCallback() SELECT widget id =", a.WidgetId, a.Name)
- Action(&a)
+ action(&a)
sleep(.1)
}
}
diff --git a/toolkit/gocui/plugin.go b/toolkit/gocui/plugin.go
index 1758690..ce47f20 100644
--- a/toolkit/gocui/plugin.go
+++ b/toolkit/gocui/plugin.go
@@ -10,8 +10,8 @@ func Quit() {
me.baseGui.Close()
}
-func Action(a *toolkit.Action) {
- log(logInfo, "Action() START", a.WidgetId, a.ActionType, a.WidgetType, a.Name)
+func action(a *toolkit.Action) {
+ log(logInfo, "action() START", a.WidgetId, a.ActionType, a.WidgetType, a.Name)
w := findWidget(a.WidgetId, me.rootNode)
switch a.ActionType {
case toolkit.Add:
@@ -21,7 +21,7 @@ func Action(a *toolkit.Action) {
} else {
// this is done to protect the plugin being 'refreshed' with the
// widget binary tree. TODO: find a way to keep them in sync
- log(logError, "Action() Add ignored for already defined widget",
+ log(logError, "action() Add ignored for already defined widget",
a.WidgetId, a.ActionType, a.WidgetType, a.Name)
}
case toolkit.Show:
@@ -39,9 +39,9 @@ func Action(a *toolkit.Action) {
case toolkit.Move:
log(logNow, "attempt to move() =", a.ActionType, a.WidgetType, a.Name)
default:
- log(logError, "Action() Unknown =", a.ActionType, a.WidgetType, a.Name)
+ log(logError, "action() Unknown =", a.ActionType, a.WidgetType, a.Name)
}
- log(logInfo, "Action() END")
+ log(logInfo, "action() END")
}
func (w *cuiWidget) AddText(text string) {
@@ -70,8 +70,6 @@ func (w *cuiWidget) SetText(text string) {
func (w *cuiWidget) Set(val any) {
log(logInfo, "Set() value =", val)
- var a toolkit.Action
- a.ActionType = toolkit.Set
switch v := val.(type) {
case bool:
@@ -82,6 +80,6 @@ func (w *cuiWidget) Set(val any) {
case int:
w.i = val.(int)
default:
- log(logError, "Set() unknown type =", v, "a =", a)
+ log(logError, "Set() unknown type =", val, v)
}
}