2024-01-17 23:54:19 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"go.wit.com/log"
|
|
|
|
"go.wit.com/toolkits/tree"
|
2024-01-18 04:27:19 -06:00
|
|
|
"go.wit.com/widget"
|
2024-01-17 23:54:19 -06:00
|
|
|
)
|
|
|
|
|
2024-02-05 12:06:17 -06:00
|
|
|
func addText(n *tree.Node, s string) {
|
2024-01-17 23:54:19 -06:00
|
|
|
var tk *guiWidget
|
|
|
|
tk = n.TK.(*guiWidget)
|
2024-02-05 12:06:17 -06:00
|
|
|
log.Log(ANDLABS, "addText() START with s =", s)
|
2024-01-17 23:54:19 -06:00
|
|
|
if tk == nil {
|
|
|
|
log.Log(ERROR, "addText error. tk == nil", n.State.ProgName, n.WidgetId)
|
|
|
|
return
|
|
|
|
}
|
2024-02-05 12:06:17 -06:00
|
|
|
log.Log(ANDLABS, "addText() Attempt on", n.WidgetType, "with", s)
|
2024-01-17 23:54:19 -06:00
|
|
|
|
|
|
|
switch n.WidgetType {
|
|
|
|
case widget.Dropdown:
|
2024-02-09 03:44:21 -06:00
|
|
|
addDropdownName(n, s)
|
2024-01-17 23:54:19 -06:00
|
|
|
case widget.Combobox:
|
2024-02-05 12:06:17 -06:00
|
|
|
addComboboxName(n, s)
|
2024-01-17 23:54:19 -06:00
|
|
|
default:
|
2024-02-05 12:06:17 -06:00
|
|
|
log.Log(ERROR, "addText() doesn't work on", n.WidgetType)
|
2024-01-17 23:54:19 -06:00
|
|
|
}
|
2024-02-05 12:06:17 -06:00
|
|
|
log.Log(ANDLABS, "addText() END with =", s)
|
2024-01-17 23:54:19 -06:00
|
|
|
}
|