diff options
| author | Jeff Carr <[email protected]> | 2024-01-17 23:39:03 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-17 23:39:03 -0600 |
| commit | a0baba0821441d9cf38f0b33fe12fb96925c6236 (patch) | |
| tree | 2aece2a890c66c36b08524e117753817078ee58c /tree/plugin.go | |
| parent | bee272651ad38453aef27f098513f7be652c39bf (diff) | |
new paths
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'tree/plugin.go')
| -rw-r--r-- | tree/plugin.go | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/tree/plugin.go b/tree/plugin.go deleted file mode 100644 index d7468e4..0000000 --- a/tree/plugin.go +++ /dev/null @@ -1,50 +0,0 @@ -package tree - -/* - These 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 ( - "go.wit.com/gui/widget" -) - -// searches the binary tree for a WidgetId -func (n *Node) FindWidgetId(id int) *Node { - if (n == nil) { - return nil - } - - if n.WidgetId == id { - return n - } - - for _, child := range n.children { - newN := child.FindWidgetId(id) - if (newN != nil) { - return newN - } - } - return nil -} - -// 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 (me *TreeInfo) Callback(guiCallback chan widget.Action) { - me.callback = guiCallback -} - -func (me *TreeInfo) PluginChannel() chan widget.Action { - return me.pluginChan -} |
