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 --- andlabs/common.go | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) mode change 120000 => 100644 andlabs/common.go (limited to 'andlabs/common.go') diff --git a/andlabs/common.go b/andlabs/common.go deleted file mode 120000 index 35417a1..0000000 --- a/andlabs/common.go +++ /dev/null @@ -1 +0,0 @@ -../nocui/common.go \ No newline at end of file diff --git a/andlabs/common.go b/andlabs/common.go new file mode 100644 index 0000000..1cfac84 --- /dev/null +++ b/andlabs/common.go @@ -0,0 +1,61 @@ +package main + +import ( + "go.wit.com/gui/widget" +) + +type node struct { + parent *node + children []*node + + WidgetId int // widget ID + WidgetType widget.WidgetType + ParentId int // parent ID + + state widget.State + + // a reference name for programming and debuggign. Must be unique + progname string + + // the text used for button labesl, window titles, checkbox names, etc + label string + + // horizontal means layout widgets like books on a bookshelf + // vertical means layout widgets like books in a stack + // direction widget.Orientation + direction widget.Orientation + + // This is how the values are passed back and forth + // values from things like checkboxes & dropdown's + value any + + strings []string + + // This is used for things like a slider(0,100) + X int + Y int + + // This is for the grid size & widget position + W int + H int + AtW int + AtH int + + vals []string // dropdown menu items + + // horizontal bool `default:false` + + hasTabs bool // does the window have tabs? + currentTab bool // the visible tab + + // 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 *guiWidget +} + +/* +func (n *node) doUserEvent() { + log.Log(ERROR, "doUserEvent() ERROR") +} +*/ -- cgit v1.2.3