From 841e6252c95244f0ee7faf2c01d33f69a8ab483a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 17 Jan 2024 21:31:49 -0600 Subject: common tree package for toolkits This update provides *lots* of toolkit updates. This will allow the next step of debugging the gocui toolkit to make it work again. There are new common routines for handling the plugin channel communication Signed-off-by: Jeff Carr --- nocui/tree.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 nocui/tree.go (limited to 'nocui/tree.go') diff --git a/nocui/tree.go b/nocui/tree.go new file mode 100644 index 0000000..784e923 --- /dev/null +++ b/nocui/tree.go @@ -0,0 +1,24 @@ +package main + +/* + This is reference code for toolkit developers +*/ + +import ( + "go.wit.com/gui/widget" +) + +// Other goroutines must use this to access the GUI +// +// You can not acess / process the GUI thread directly from +// other goroutines. This is due to the nature of how +// Linux, MacOS and Windows work (they all work differently. suprise. surprise.) +// +// this sets the channel to send user events back from the plugin +func Callback(guiCallback chan widget.Action) { + me.myTree.Callback(guiCallback) +} + +func PluginChannel() chan widget.Action { + return me.myTree.PluginChannel() +} -- cgit v1.2.3