diff options
| author | Jeff Carr <[email protected]> | 2023-04-06 19:48:24 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-04-06 19:48:24 -0500 |
| commit | 8649f37a56bc31928d69077545f1e323a794c61a (patch) | |
| tree | a3567c8f8a6b3caa8402a0640baa56630dcf972e /toolkit/andlabs/common.go | |
| parent | 6fb44679a28b29b60018b037c6f328cf3e98f934 (diff) | |
andlabs: use callback channel for window close
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/common.go')
| -rw-r--r-- | toolkit/andlabs/common.go | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/toolkit/andlabs/common.go b/toolkit/andlabs/common.go index cddea3e..d905e5c 100644 --- a/toolkit/andlabs/common.go +++ b/toolkit/andlabs/common.go @@ -6,10 +6,10 @@ import ( 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 (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 @@ -28,11 +28,20 @@ func (t *andlabsT) commonChange(tw *toolkit.Widget, wId int) { log(debugChange, "commonChange() END Widget.Custom()", t.Name, t.WidgetType) } -func sendToChan(i int) bool { +func (t *andlabsT) doUserEvent() { if (callback == nil) { - log(debugError, "commonChange() SHOULD SEND int back here, but callback == nil", i) - return false + log(debugError, "douserEvent() callback == nil", t.wId) + return } - log(debugError, "commonChange() Running callback() i =", i) - return callback(i) + var a toolkit.Action + a.WidgetId = t.wId + a.Name = t.Name + a.S = t.s + a.I = t.i + a.B = t.b + a.ActionType = toolkit.User + log(logNow, "START: send a user event to the callback channel") + callback <- a + log(logNow, "END: sent a user event to the callback channel") + return } |
