more node state fixes
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
695f116eec
commit
142be47d3a
15
addText.go
15
addText.go
|
@ -6,9 +6,6 @@ import (
|
||||||
"go.wit.com/widget"
|
"go.wit.com/widget"
|
||||||
)
|
)
|
||||||
|
|
||||||
func compareStrings(n *tree.Node, ss []string) {
|
|
||||||
}
|
|
||||||
|
|
||||||
func addText(n *tree.Node, s string) {
|
func addText(n *tree.Node, s string) {
|
||||||
var tk *guiWidget
|
var tk *guiWidget
|
||||||
tk = n.TK.(*guiWidget)
|
tk = n.TK.(*guiWidget)
|
||||||
|
@ -21,19 +18,7 @@ func addText(n *tree.Node, s string) {
|
||||||
|
|
||||||
switch n.WidgetType {
|
switch n.WidgetType {
|
||||||
case widget.Dropdown:
|
case widget.Dropdown:
|
||||||
for i, s := range n.State.Strings {
|
|
||||||
log.Log(ANDLABS, "n.State.Strings =", i, s)
|
|
||||||
_, ok := n.Strings[s]
|
|
||||||
// If the key exists
|
|
||||||
if ok {
|
|
||||||
log.Log(ANDLABS, "string is already in the dropdown", i, s)
|
|
||||||
} else {
|
|
||||||
log.Log(ANDLABS, "adding new string to dropdown", i, s)
|
|
||||||
addDropdownName(n, s)
|
addDropdownName(n, s)
|
||||||
// TODO: make numbers
|
|
||||||
n.Strings[s] = 21
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case widget.Combobox:
|
case widget.Combobox:
|
||||||
addComboboxName(n, s)
|
addComboboxName(n, s)
|
||||||
default:
|
default:
|
||||||
|
|
7
main.go
7
main.go
|
@ -59,6 +59,12 @@ func queueSetChecked(n *tree.Node, b bool) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func queueToolkitClose() {
|
||||||
|
ui.QueueMain(func() {
|
||||||
|
ui.Quit()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
func queueMain(currentA widget.Action) {
|
func queueMain(currentA widget.Action) {
|
||||||
// this never happends
|
// this never happends
|
||||||
|
@ -130,6 +136,7 @@ func init() {
|
||||||
me.myTree.SetText = queueSetText
|
me.myTree.SetText = queueSetText
|
||||||
me.myTree.AddText = queueAddText
|
me.myTree.AddText = queueAddText
|
||||||
me.myTree.SetChecked = queueSetChecked
|
me.myTree.SetChecked = queueSetChecked
|
||||||
|
me.myTree.ToolkitClose = queueToolkitClose
|
||||||
|
|
||||||
// TODO: this is messed up. run ui.Main() from the first add? Initialize it with an empty thing first?
|
// TODO: this is messed up. run ui.Main() from the first add? Initialize it with an empty thing first?
|
||||||
// fake out the OS toolkit by making a fake window. This is probably needed for macos & windows
|
// fake out the OS toolkit by making a fake window. This is probably needed for macos & windows
|
||||||
|
|
Loading…
Reference in New Issue