summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/common.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-06 20:25:14 -0500
committerJeff Carr <[email protected]>2023-04-06 20:25:14 -0500
commit933a7e4df0e6a28ad06dfd60ab2928d5cdf916f9 (patch)
tree268ad3d290b392f877963a6fdc82197168f51fc4 /toolkit/andlabs/common.go
parent8649f37a56bc31928d69077545f1e323a794c61a (diff)
andlabs: callback is now safe through a go channel
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/common.go')
-rw-r--r--toolkit/andlabs/common.go30
1 files changed, 3 insertions, 27 deletions
diff --git a/toolkit/andlabs/common.go b/toolkit/andlabs/common.go
index d905e5c..cd8e9c8 100644
--- a/toolkit/andlabs/common.go
+++ b/toolkit/andlabs/common.go
@@ -4,33 +4,9 @@ import (
"git.wit.org/wit/gui/toolkit"
)
-func (t *andlabsT) commonChange(tw *toolkit.Widget, wId int) {
- log(debugChange, "commonChange() START widget =", t.Name, t.WidgetType)
-// if (sendToChan(wId)) {
-// log(debugChange, "commonChange() END attempted channel worked", t.Name, t.WidgetType)
-// return
-// }
- if (tw == nil) {
- log(true, "commonChange() What the fuck. there is no widget t.tw == nil")
- return
- }
- if (tw.Custom == nil) {
- log(debugChange, "commonChange() END Widget.Custom() = nil", t.Name, t.WidgetType)
- return
- }
- tw.Custom()
-
- if (andlabs[wId] == nil) {
- log(debugError, "commonChange() ERROR: wId map == nil", wId)
- return
- }
-
- log(debugChange, "commonChange() END Widget.Custom()", t.Name, t.WidgetType)
-}
-
func (t *andlabsT) doUserEvent() {
if (callback == nil) {
- log(debugError, "douserEvent() callback == nil", t.wId)
+ log(debugError, "doUserEvent() callback == nil", t.wId)
return
}
var a toolkit.Action
@@ -40,8 +16,8 @@ func (t *andlabsT) doUserEvent() {
a.I = t.i
a.B = t.b
a.ActionType = toolkit.User
- log(logNow, "START: send a user event to the callback channel")
+ log(logInfo, "doUserEvent() START: send a user event to the callback channel")
callback <- a
- log(logNow, "END: sent a user event to the callback channel")
+ log(logInfo, "doUserEvent() END: sent a user event to the callback channel")
return
}