diff options
| author | Jeff Carr <[email protected]> | 2024-01-17 21:31:49 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-17 21:31:49 -0600 |
| commit | 841e6252c95244f0ee7faf2c01d33f69a8ab483a (patch) | |
| tree | ef400228622b87611168db2227269ba7fd56625d /tree/structs.go | |
| parent | ba95c13799740b5f55541fc5e8ab9f1d34f7e421 (diff) | |
common tree package for toolkitsv0.12.4
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 <[email protected]>
Diffstat (limited to 'tree/structs.go')
| -rw-r--r-- | tree/structs.go | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tree/structs.go b/tree/structs.go new file mode 100644 index 0000000..e998b6f --- /dev/null +++ b/tree/structs.go @@ -0,0 +1,51 @@ +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/log" + "go.wit.com/gui/widget" +) + +// var me *TreeInfo + +type TreeInfo struct { + // this is the channel we send user events like + // mouse clicks or keyboard events back to the program + callback chan widget.Action + + // this is the channel we get requests to make widgets + pluginChan chan widget.Action + + treeRoot *Node + NodeI interface {} + ActionFromChannel func (widget.Action) () + PluginName string +} + +type Node struct { + Parent *Node + children []*Node + + WidgetId int // widget ID + WidgetType widget.WidgetType + ParentId int // parent ID + + State widget.State + + Strings map[string]int + + // the internal plugin toolkit structure + // in the gtk plugin, it has gtk things like margin & border settings + // in the text console one, it has text console things like colors for menus & buttons + TK any +} |
