2024-01-01 16:11:54 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-01-17 21:31:49 -06:00
|
|
|
"go.wit.com/gui/toolkits/tree"
|
2024-01-16 12:55:20 -06:00
|
|
|
|
2024-01-15 16:11:40 -06:00
|
|
|
"go.wit.com/dev/andlabs/ui"
|
|
|
|
_ "go.wit.com/dev/andlabs/ui/winmanifest"
|
2024-01-01 16:11:54 -06:00
|
|
|
)
|
|
|
|
|
2024-01-17 21:31:49 -06:00
|
|
|
// func (p *node) newButton(n *node) {
|
|
|
|
func newButton(p *tree.Node, n *tree.Node) {
|
|
|
|
if notNew(n) { return }
|
|
|
|
var ptk *guiWidget
|
|
|
|
ptk = p.TK.(*guiWidget)
|
2024-01-01 16:11:54 -06:00
|
|
|
newt := new(guiWidget)
|
|
|
|
|
2024-01-17 21:31:49 -06:00
|
|
|
b := ui.NewButton(n.GetLabel())
|
2024-01-01 16:11:54 -06:00
|
|
|
newt.uiButton = b
|
|
|
|
newt.uiControl = b
|
2024-01-17 21:31:49 -06:00
|
|
|
newt.parent = ptk
|
2024-01-01 16:11:54 -06:00
|
|
|
|
|
|
|
b.OnClicked(func(*ui.Button) {
|
2024-01-17 21:31:49 -06:00
|
|
|
me.myTree.DoUserEvent(n)
|
2024-01-01 16:11:54 -06:00
|
|
|
})
|
|
|
|
|
2024-01-17 21:31:49 -06:00
|
|
|
n.TK = newt
|
|
|
|
place(p, n)
|
2024-01-01 16:11:54 -06:00
|
|
|
}
|