summaryrefslogtreecommitdiff
path: root/toolkit/gocui/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-08 15:34:36 -0500
committerJeff Carr <[email protected]>2023-04-08 15:34:36 -0500
commitb24cc5898604191df7bfc2cacd7bc5043fa14a42 (patch)
tree31c011056e67b103ef62c33434ff04fe345a3571 /toolkit/gocui/main.go
parent0e0787c0620c0dca59378d1e3b355c60a1a82de1 (diff)
gocui: compiling and running again
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/gocui/main.go')
-rw-r--r--toolkit/gocui/main.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/toolkit/gocui/main.go b/toolkit/gocui/main.go
index e2ec85f..f9611c1 100644
--- a/toolkit/gocui/main.go
+++ b/toolkit/gocui/main.go
@@ -50,6 +50,15 @@ func catchActionChannel() {
log(logInfo, "catchActionChannel() infinite for() loop restarted select on channel")
select {
case a := <-me.pluginChan:
+ // this plugin can be loaded, but it doesn't actually do anything until
+ // the calling program sends an action to it. Then, it actually will initialize
+ // the tty and take over your console
+ if (me.baseGui == nil) {
+ log(logError,"main() was not run yet")
+ go main()
+ // probably not needed, but in here for now under development
+ sleep(1)
+ }
log(logNow, "catchActionChannel()", a.WidgetId, a.ActionType, a.WidgetType, a.Name)
action(&a)
}
@@ -61,8 +70,8 @@ func Exit() {
me.baseGui.Close()
}
-func Main(f func()) {
- log("start Init()")
+func main() {
+ log(logInfo, "main() start Init()")
outf, err := os.OpenFile("/tmp/witgui.log", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666)
if err != nil {