summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/common.go
blob: cddea3e9ce3dcce0e6dd1ae444bc84a2799a4ca2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main

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 sendToChan(i int) bool {
	if (callback == nil) {
		log(debugError, "commonChange() SHOULD SEND int back here, but callback == nil", i)
		return false
	}
	log(debugError, "commonChange() Running callback() i =", i)
	return callback(i)
}