summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/gocui/debug.go19
-rw-r--r--toolkit/gocui/log.go6
-rw-r--r--toolkit/gocui/main.go11
3 files changed, 9 insertions, 27 deletions
diff --git a/toolkit/gocui/debug.go b/toolkit/gocui/debug.go
index e569872..9b57b08 100644
--- a/toolkit/gocui/debug.go
+++ b/toolkit/gocui/debug.go
@@ -2,27 +2,8 @@ package main
import (
"fmt"
-
- "git.wit.org/wit/gui/toolkit"
-// "github.com/awesome-gocui/gocui"
)
-// var debugAction bool = false
-
-func actionDump(b bool, a *toolkit.Action) {
- if (a == nil) {
- log(b, "action = nil")
- return
- }
-
- log(b, "a.Name =", a.Name)
- log(b, "a.Text =", a.Text)
- log(b, "a.WidgetId =", a.WidgetId)
- log(b, "a.ParentId =", a.ParentId)
- log(b, "a.B =", a.B)
- log(b, "a.S =", a.S)
-}
-
func (w *cuiWidget) dumpTree(draw bool) {
if (w == nil) {
return
diff --git a/toolkit/gocui/log.go b/toolkit/gocui/log.go
index 44bcf6c..222332d 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 = true
-var logInfo bool = true
-var logVerbose bool = true
+var logWarn bool = false
+var logInfo bool = false
+var logVerbose bool = false
func log(a ...any) {
witlog.Where = "wit/gocui"
diff --git a/toolkit/gocui/main.go b/toolkit/gocui/main.go
index ed9670a..e2ec85f 100644
--- a/toolkit/gocui/main.go
+++ b/toolkit/gocui/main.go
@@ -9,6 +9,8 @@ import (
"git.wit.org/wit/gui/toolkit"
)
+// sets defaults and establishes communication
+// to this toolkit from the wit/gui golang package
func Init() {
log(logInfo, "Init() of awesome-gocui")
me.defaultWidth = 10
@@ -43,20 +45,19 @@ func PluginChannel() chan toolkit.Action {
}
func catchActionChannel() {
- log(logNow, "makeCallback() START")
+ log(logInfo, "catchActionChannel() START")
for {
- log(logNow, "makeCallback() for loop")
+ log(logInfo, "catchActionChannel() infinite for() loop restarted select on channel")
select {
case a := <-me.pluginChan:
- log(logNow, "makeCallback() SELECT widget id =", a.WidgetId, a.Name)
+ log(logNow, "catchActionChannel()", a.WidgetId, a.ActionType, a.WidgetType, a.Name)
action(&a)
- sleep(.1)
}
}
}
func Exit() {
- // TODO: send exit to the plugin
+ // TODO: what should actually happen here?
me.baseGui.Close()
}