summaryrefslogtreecommitdiff
path: root/structs.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-03 00:12:12 -0600
committerJeff Carr <[email protected]>2025-03-03 00:12:12 -0600
commit9554b6a28765db7debce2cc27587476dc90e5d3e (patch)
treec51498613fe49a106d657ef70a94643510a4929e /structs.go
parent71c137c56b5541b3c049d513ec3dcf1c3502fe08 (diff)
starting to stub in widgetpb
Diffstat (limited to 'structs.go')
-rw-r--r--structs.go29
1 files changed, 12 insertions, 17 deletions
diff --git a/structs.go b/structs.go
index a3a1781..704202e 100644
--- a/structs.go
+++ b/structs.go
@@ -40,16 +40,12 @@ type guiConfig struct {
// a toolkit requirement. never allow more than one per program
initOnce sync.Once
- // locking for the binary tree
- muTree sync.Mutex
-
- // This is the master node. The Binary Tree starts here
- rootNode *Node
+ rootNode *Node // This is the master node. The Binary Tree starts here
+ widgets *guipb.Widgets // the protobuf. switch to this. deprecate rootNode
+ counter int // used to make unique WidgetId's
// A node off of rootNode for passing debugging flags
- flag *Node
-
- counter int // used to make unique WidgetId's
+ // flag *Node
// sets the chan for the plugins to call back too
guiChan chan widget.Action
@@ -87,12 +83,12 @@ type guiConfig struct {
*/
type Node struct {
- id int // should be unique
- hidden bool // don't update the toolkits when it's hidden
- changed bool // do we need to inform the toolkit something changed?
- enabled bool // if false, then the the user can't click on it
- mu sync.Mutex
-
+ widget *guipb.Widget // deprecate everything below and switch to this protobuf
+ id int // should be unique
+ hidden bool // don't update the toolkits when it's hidden
+ changed bool // do we need to inform the toolkit something changed?
+ enabled bool // if false, then the the user can't click on it
+ mu sync.Mutex
WidgetType widget.WidgetType
// most widgets need one value, this is current alue
@@ -158,9 +154,8 @@ type Node struct {
NextH int
// if this widget is in a grid, this is the position of a widget
- AtW int
- AtH int
- widget guipb.Widget
+ AtW int
+ AtH int
}
type Widget interface {