2024-01-17 23:54:19 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"go.wit.com/toolkits/tree"
|
|
|
|
|
|
|
|
"go.wit.com/dev/andlabs/ui"
|
|
|
|
_ "go.wit.com/dev/andlabs/ui/winmanifest"
|
|
|
|
)
|
|
|
|
|
|
|
|
func newButton(p *tree.Node, n *tree.Node) {
|
|
|
|
if notNew(n) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var ptk *guiWidget
|
|
|
|
ptk = p.TK.(*guiWidget)
|
|
|
|
newt := new(guiWidget)
|
|
|
|
|
|
|
|
b := ui.NewButton(n.GetLabel())
|
|
|
|
newt.uiButton = b
|
|
|
|
newt.uiControl = b
|
|
|
|
newt.parent = ptk
|
|
|
|
|
|
|
|
b.OnClicked(func(*ui.Button) {
|
2024-01-19 02:52:57 -06:00
|
|
|
me.myTree.SendUserEvent(n)
|
2024-01-17 23:54:19 -06:00
|
|
|
})
|
|
|
|
|
|
|
|
n.TK = newt
|
|
|
|
place(p, n)
|
|
|
|
}
|