summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/gocui/main.go1
-rw-r--r--toolkit/gocui/plugin.go6
-rw-r--r--toolkit/widget.go5
3 files changed, 10 insertions, 2 deletions
diff --git a/toolkit/gocui/main.go b/toolkit/gocui/main.go
index de35700..f0415f5 100644
--- a/toolkit/gocui/main.go
+++ b/toolkit/gocui/main.go
@@ -83,5 +83,6 @@ func main() {
log("This is a test log entry")
MouseMain()
+ log(true, "MouseMain() closed")
me.baseGui.Close()
}
diff --git a/toolkit/gocui/plugin.go b/toolkit/gocui/plugin.go
index ce47f20..f70ae96 100644
--- a/toolkit/gocui/plugin.go
+++ b/toolkit/gocui/plugin.go
@@ -1,6 +1,7 @@
package main
import (
+ "os"
// if you include more than just this import
// then your plugin might be doing something un-ideal (just a guess from 2023/02/27)
"git.wit.org/wit/gui/toolkit"
@@ -38,6 +39,11 @@ func action(a *toolkit.Action) {
w.AddText(a.S)
case toolkit.Move:
log(logNow, "attempt to move() =", a.ActionType, a.WidgetType, a.Name)
+ case toolkit.CloseToolkit:
+ log(logNow, "attempting to close the plugin and release stdout and stderr")
+ me.baseGui.Close()
+ // defer outf.Close()
+ setOutput(os.Stdout)
default:
log(logError, "action() Unknown =", a.ActionType, a.WidgetType, a.Name)
}
diff --git a/toolkit/widget.go b/toolkit/widget.go
index 769bf09..21f2f47 100644
--- a/toolkit/widget.go
+++ b/toolkit/widget.go
@@ -109,7 +109,6 @@ const (
const (
Add ActionType = iota
- User // the user did something (mouse, keyboard, etc)
Delete
Get
Set
@@ -127,7 +126,9 @@ const (
Append
Move
Dump
- Quit
+ User // the user did something (mouse, keyboard, etc)
+ InitToolkit // initializes the toolkit
+ CloseToolkit // closes the toolkit
)
func (s WidgetType) String() string {