summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/common.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-03-24 20:14:18 -0500
committerJeff Carr <[email protected]>2023-03-24 20:14:18 -0500
commit6f91f5e080e06cdc0f34b13d23e5fd16ea37259a (patch)
tree7037a36829c644dccc7cb78ee6f87f87f88aed21 /toolkit/andlabs/common.go
parentd4787a1ebdd08359746516dbb72f1feaf95be5b6 (diff)
starting to try safe chan and goroutines
fix tab title's right before attempting to add chan goroutines removed "where" widget pointer box added to tab experiement with log as it's own repo Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/common.go')
-rw-r--r--toolkit/andlabs/common.go26
1 files changed, 12 insertions, 14 deletions
diff --git a/toolkit/andlabs/common.go b/toolkit/andlabs/common.go
index 5cfaaa5..5e1b0fb 100644
--- a/toolkit/andlabs/common.go
+++ b/toolkit/andlabs/common.go
@@ -4,7 +4,7 @@ import (
"git.wit.org/wit/gui/toolkit"
)
-func (t *andlabsT) commonChange(tw *toolkit.Widget) {
+func (t *andlabsT) commonChange(tw *toolkit.Widget, wId int) {
log(debugChange, "commonChange() START widget =", t.tw.Name, t.tw.Type)
if (tw == nil) {
log(true, "commonChange() What the fuck. there is no widget t.tw == nil")
@@ -15,23 +15,21 @@ func (t *andlabsT) commonChange(tw *toolkit.Widget) {
return
}
tw.Custom()
- log(debugChange, "commonChange() END Widget.Custom()", t.tw.Name, t.tw.Type)
-}
-func dump(p *toolkit.Widget, c *toolkit.Widget, b bool) {
- log(b, "Parent:")
- pt := mapToolkits[p]
- if (pt == nil) {
- log(b, "Trying to do something on a widget that doesn't work or doesn't exist or something", c)
+ if (andlabs[wId] == nil) {
+ log(debugError, "commonChange() ERROR: wId map == nil", wId)
return
}
- pt.Dump(b)
+ sendToChan(wId)
+
+ log(debugChange, "commonChange() END Widget.Custom()", t.tw.Name, t.tw.Type)
+}
- log(b, "Child:")
- ct := mapToolkits[c]
- if (ct == nil) {
- log(b, "Trying to do something on a widget that doesn't work or doesn't exist or something", c)
+func sendToChan(i int) {
+ if (callback == nil) {
+ log(debugError, "commonChange() SHOULD SEND int back here, but callback == nil", i)
return
}
- ct.Dump(b)
+ log(debugError, "commonChange() Running callback() i =", i)
+ callback(i)
}