summaryrefslogtreecommitdiff
path: root/structs.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-17 21:21:29 -0600
committerJeff Carr <[email protected]>2024-01-17 21:21:29 -0600
commita6a3e1193fa7c77165f3ed2eb0031f319b4abdd0 (patch)
tree2c5a9fbf4dbc5f7bd5cb235542082da5eba342c6 /structs.go
parent8ef3fc7a73a004385d36561c6c8acc4be7e3e24b (diff)
work around a toolkit panic()v0.12.11
things should work when GUI is not really there Int() and Bool() helloworld works compiles and runs RawWindow shouldn't auto exit add StandardExit() Signed-off-by: Jeff Carr <[email protected]> Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'structs.go')
-rw-r--r--structs.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/structs.go b/structs.go
index 7139cea..f9bfed5 100644
--- a/structs.go
+++ b/structs.go
@@ -38,6 +38,9 @@ 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
@@ -87,18 +90,22 @@ type Node struct {
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
value any
+ //
+ label string
+
// this can programatically identify the widget
// The name must be unique
progname string // a name useful for debugging
// for widgets that a user select from a list of strings
- strings []string
+ strings map[string]int
// how to arrange widgets
direction widget.Orientation