summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-28 10:35:57 -0500
committerJeff Carr <[email protected]>2023-04-28 10:35:57 -0500
commit923f7721cca66d84dea77ffd9640d793803142ee (patch)
tree824c9a2b83f574c37279c8526a1566035e78c2bb /main.go
parent03942de00e133daf59da8ed3b6c3e71ce8afe316 (diff)
s/Config/me/ to remove direct access to anything
since most everything needs to be passed to the toolkits everything should be accessed via func()'s Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'main.go')
-rw-r--r--main.go30
1 files changed, 15 insertions, 15 deletions
diff --git a/main.go b/main.go
index 877f4aa..c6ec163 100644
--- a/main.go
+++ b/main.go
@@ -17,21 +17,21 @@ const Yaxis = 1 // stack things vertically
func init() {
log("init() has been run")
- Config.counter = 0
- Config.prefix = "wit"
+ me.counter = 0
+ me.prefix = "wit"
// Populates the top of the binary tree
- Config.rootNode = addNode("guiBinaryTree")
- Config.rootNode.WidgetType = toolkit.Root
+ me.rootNode = addNode("guiBinaryTree")
+ me.rootNode.WidgetType = toolkit.Root
// used to pass debugging flags to the toolkit plugins
- Config.flag = Config.rootNode.newNode("flag", 0, nil)
- Config.flag.WidgetType = toolkit.Flag
+ me.flag = me.rootNode.newNode("flag", 0, nil)
+ me.flag.WidgetType = toolkit.Flag
- Config.flag = Config.rootNode.newNode("stdout", 0, nil)
- Config.flag.WidgetType = toolkit.Stdout
+ me.flag = me.rootNode.newNode("stdout", 0, nil)
+ me.flag.WidgetType = toolkit.Stdout
- Config.guiChan = make(chan toolkit.Action, 1)
+ me.guiChan = make(chan toolkit.Action, 1)
go watchCallback()
}
@@ -40,10 +40,10 @@ func watchCallback() {
for {
log(logNow, "watchCallback() restarted select for toolkit user events")
select {
- case a := <-Config.guiChan:
+ case a := <-me.guiChan:
if (a.ActionType == toolkit.UserQuit) {
log(logNow, "doUserEvent() User sent Quit()")
- Config.rootNode.doCustom()
+ me.rootNode.doCustom()
exit("wit/gui toolkit.UserQuit")
break
}
@@ -53,7 +53,7 @@ func watchCallback() {
break
}
- n := Config.rootNode.FindId(a.WidgetId)
+ n := me.rootNode.FindId(a.WidgetId)
if (n == nil) {
log(logError, "watchCallback() UNKNOWN widget id =", a.WidgetId, a.Name)
} else {
@@ -115,7 +115,7 @@ func (n *Node) doUserEvent(a toolkit.Action) {
}
func (n *Node) InitEmbed(resFS embed.FS) *Node {
- Config.resFS = resFS
+ me.resFS = resFS
return n
}
@@ -162,7 +162,7 @@ func (n *Node) LoadToolkit(name string) *Node {
sleep(.5) // temp hack until chan communication is setup
// TODO: find a new way to do this that is locking, safe and accurate
- Config.rootNode.redraw(plug)
+ me.rootNode.redraw(plug)
log(logInfo, "LoadToolkit() END for name =", name)
return n
}
@@ -188,7 +188,7 @@ func (n *Node) CloseToolkit(name string) bool {
// some toolkit's on some operating systems don't support more than one
// Keep things simple. Do the default expected thing whenever possible
func New() *Node {
- return Config.rootNode
+ return me.rootNode
}
// try to load andlabs, if that doesn't work, fall back to the console