summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugin.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugin.go b/plugin.go
index 396829d..1f3bc98 100644
--- a/plugin.go
+++ b/plugin.go
@@ -333,6 +333,22 @@ func (n *Node) ListToolkits() {
}
}
+// cleanly close all toolkits
+func (n *Node) Close() {
+ Exit()
+}
+
+func Exit() {
+ log.Log(PLUG, "Closing all toolkits")
+ for _, plug := range allPlugins {
+ log.Log(PLUG, "Exit() found plugin", plug.name)
+ var a widget.Action
+ a.ActionType = widget.ToolkitClose
+ plug.pluginChan <- a
+ }
+ allPlugins = nil
+}
+
func (n *Node) CloseToolkit(name string) bool {
log.Log(PLUG, "CloseToolkit() for name =", name)
for i, plug := range allPlugins {