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-03-23 12:35:12 -05:00
|
|
|
log(debugChange, "commonChange() START widget =", t.tw.Name, t.tw.Type)
|
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) {
|
|
|
|
log(debugChange, "commonChange() END Widget.Custom() = nil", t.tw.Name, t.tw.Type)
|
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
|
|
|
sendToChan(wId)
|
|
|
|
|
|
|
|
log(debugChange, "commonChange() END Widget.Custom()", t.tw.Name, t.tw.Type)
|
|
|
|
}
|
2023-03-03 14:41:38 -06:00
|
|
|
|
2023-03-29 23:03:04 -05:00
|
|
|
func sendToChan(i int) {
|
|
|
|
if (callback == nil) {
|
|
|
|
log(debugError, "commonChange() SHOULD SEND int back here, but callback == nil", i)
|
2023-03-03 14:41:38 -06:00
|
|
|
return
|
|
|
|
}
|
2023-03-29 23:03:04 -05:00
|
|
|
log(debugError, "commonChange() Running callback() i =", i)
|
|
|
|
callback(i)
|
2023-03-03 14:41:38 -06:00
|
|
|
}
|