summaryrefslogtreecommitdiff
path: root/toolkit/gocui/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-06 18:00:18 -0500
committerJeff Carr <[email protected]>2023-04-06 18:00:18 -0500
commitbf60121b6515681ac505e80cb6824ba6bd978c29 (patch)
treecdb87a9169185da1c33827702ef1b405c3d1ed00 /toolkit/gocui/main.go
parent70f8797122741ef61951d3400317173a1d9974da (diff)
gocui: callbacks work via a channel
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/gocui/main.go')
-rw-r--r--toolkit/gocui/main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/toolkit/gocui/main.go b/toolkit/gocui/main.go
index ab50237..6821a82 100644
--- a/toolkit/gocui/main.go
+++ b/toolkit/gocui/main.go
@@ -6,6 +6,7 @@ package main
import (
"os"
+ "git.wit.org/wit/gui/toolkit"
)
func Init() {
@@ -27,6 +28,11 @@ func Init() {
me.padH = 3
}
+// this sets the channel to send user events back from the plugin
+func Callback(guiCallback chan toolkit.Action) {
+ me.callback = guiCallback
+}
+
func Exit() {
// TODO: exit correctly
me.baseGui.Close()