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)
|
2023-04-06 19:48:24 -05:00
|
|
|
// 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-06 19:48:24 -05:00
|
|
|
func (t *andlabsT) doUserEvent() {
|
2023-03-29 23:03:04 -05:00
|
|
|
if (callback == nil) {
|
2023-04-06 19:48:24 -05:00
|
|
|
log(debugError, "douserEvent() callback == nil", t.wId)
|
|
|
|
return
|
2023-03-03 14:41:38 -06:00
|
|
|
}
|
2023-04-06 19:48:24 -05:00
|
|
|
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
|
2023-03-03 14:41:38 -06:00
|
|
|
}
|