2022-11-13 08:53:03 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.wit.org/wit/gui/toolkit"
|
|
|
|
)
|
|
|
|
|
|
|
|
// This is a map between the widgets in wit/gui and the internal structures of gocui
|
|
|
|
|
|
|
|
var mapWidgets map[*andlabsT]*toolkit.Widget
|
|
|
|
var mapToolkits map[*toolkit.Widget]*andlabsT
|
|
|
|
|
|
|
|
// This lists out the know mappings
|
|
|
|
func listMap() {
|
2023-02-25 14:05:25 -06:00
|
|
|
log(debugToolkit, "listMap() HERE")
|
|
|
|
log(debugToolkit, "listMap() HERE")
|
|
|
|
log(debugToolkit, "listMap() HERE mapWidgets()")
|
2022-11-13 08:53:03 -06:00
|
|
|
for t, w := range mapWidgets {
|
2023-02-25 14:05:25 -06:00
|
|
|
log(debugToolkit, "andlabs =", t.Name, "widget =", w.Name)
|
2022-11-13 08:53:03 -06:00
|
|
|
}
|
2023-02-25 14:05:25 -06:00
|
|
|
log(debugToolkit, "listMap() HERE mapToolkits()")
|
2022-11-13 08:53:03 -06:00
|
|
|
for w, t := range mapToolkits {
|
2023-02-25 14:05:25 -06:00
|
|
|
log(debugToolkit, "andlabs =", t, "widget =", w.Name)
|
2022-11-13 08:53:03 -06:00
|
|
|
forceDump(t)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func mapWidgetsToolkits(w *toolkit.Widget, t *andlabsT) {
|
|
|
|
if (mapToolkits[w] == nil) {
|
|
|
|
mapToolkits[w] = t
|
|
|
|
} else {
|
2023-02-25 14:05:25 -06:00
|
|
|
log(debugToolkit, "WTF: mapToolkits was sent nil. this should not happen w =", w)
|
|
|
|
log(debugToolkit, "WTF: mapToolkits was sent nil. this should not happen t =", t.Width)
|
|
|
|
log(debugToolkit, "WTF: mapToolkits map already set to ", mapToolkits[w])
|
|
|
|
panic("WTF mapWidgetsToolkits() w == nil")
|
2022-11-13 08:53:03 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
if (mapWidgets[t] == nil) {
|
|
|
|
mapWidgets[t] = w
|
|
|
|
} else {
|
2023-02-25 14:05:25 -06:00
|
|
|
log(debugToolkit, "WTF: mapWidgets already installed. w =", w)
|
|
|
|
log(debugToolkit, "WTF: mapWidgets already installed. t =", t.Width, t)
|
|
|
|
log(SPEW, &t)
|
|
|
|
log(SPEW, t)
|
|
|
|
log(SPEW, *t)
|
|
|
|
log(debugToolkit, "WTF: mapWidgets already mapped to", mapWidgets[t])
|
|
|
|
log(SPEW, mapWidgets[t])
|
|
|
|
panic("WTF. mapWidget andlabs toolkit already mapped to gui toolkit")
|
2022-11-13 08:53:03 -06:00
|
|
|
}
|
|
|
|
}
|