2024-01-17 23:54:19 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
/*
|
|
|
|
This code should be common to all gui plugins
|
|
|
|
|
|
|
|
There are some helper functions that are probably going to be
|
|
|
|
the same everywhere. Mostly due to handling the binary tree structure
|
|
|
|
and the channel communication
|
|
|
|
|
|
|
|
For now, it's just a symlink to the 'master' version in
|
|
|
|
./toolkit/nocui/common.go
|
|
|
|
*/
|
|
|
|
|
|
|
|
import (
|
2024-01-18 04:27:19 -06:00
|
|
|
"go.wit.com/widget"
|
2024-01-17 23:54:19 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
// 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()
|
|
|
|
}
|