2022-11-14 14:30:28 -06:00
|
|
|
package main
|
2022-10-21 11:40:08 -05:00
|
|
|
|
2023-03-01 11:35:36 -06:00
|
|
|
import (
|
|
|
|
"git.wit.org/wit/gui/toolkit"
|
|
|
|
)
|
|
|
|
|
2023-03-29 23:03:04 -05:00
|
|
|
func (t *andlabsT) commonChange(tw *toolkit.Widget, wId int) {
|
2023-04-03 10:26:47 -05:00
|
|
|
log(debugChange, "commonChange() START widget =", t.Name, t.WidgetType)
|
|
|
|
if (sendToChan(wId)) {
|
|
|
|
log(debugChange, "commonChange() END attempted channel worked", t.Name, t.WidgetType)
|
|
|
|
return
|
|
|
|
}
|
2023-03-01 11:35:36 -06:00
|
|
|
if (tw == nil) {
|
|
|
|
log(true, "commonChange() What the fuck. there is no widget t.tw == nil")
|
2023-02-25 14:05:25 -06:00
|
|
|
return
|
|
|
|
}
|
2023-03-01 11:35:36 -06:00
|
|
|
if (tw.Custom == nil) {
|
2023-04-03 10:26:47 -05:00
|
|
|
log(debugChange, "commonChange() END Widget.Custom() = nil", t.Name, t.WidgetType)
|
2023-02-25 14:05:25 -06:00
|
|
|
return
|
|
|
|
}
|
2023-03-01 11:35:36 -06:00
|
|
|
tw.Custom()
|
2022-10-21 11:40:08 -05:00
|
|
|
|
2023-03-29 23:03:04 -05:00
|
|
|
if (andlabs[wId] == nil) {
|
|
|
|
log(debugError, "commonChange() ERROR: wId map == nil", wId)
|
2023-03-03 14:41:38 -06:00
|
|
|
return
|
|
|
|
}
|
2023-03-29 23:03:04 -05:00
|
|
|
|
2023-04-03 10:26:47 -05:00
|
|
|
log(debugChange, "commonChange() END Widget.Custom()", t.Name, t.WidgetType)
|
2023-03-29 23:03:04 -05:00
|
|
|
}
|
2023-03-03 14:41:38 -06:00
|
|
|
|
2023-04-03 10:26:47 -05:00
|
|
|
func sendToChan(i int) bool {
|
2023-03-29 23:03:04 -05:00
|
|
|
if (callback == nil) {
|
|
|
|
log(debugError, "commonChange() SHOULD SEND int back here, but callback == nil", i)
|
2023-04-03 10:26:47 -05:00
|
|
|
return false
|
2023-03-03 14:41:38 -06:00
|
|
|
}
|
2023-03-29 23:03:04 -05:00
|
|
|
log(debugError, "commonChange() Running callback() i =", i)
|
2023-04-03 10:26:47 -05:00
|
|
|
return callback(i)
|
2023-03-03 14:41:38 -06:00
|
|
|
}
|