From a6a3e1193fa7c77165f3ed2eb0031f319b4abdd0 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 17 Jan 2024 21:21:29 -0600 Subject: work around a toolkit panic() 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 Signed-off-by: Jeff Carr --- structs.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'structs.go') 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 -- cgit v1.2.3