package main

import (
	"go.wit.com/dev/andlabs/ui"
	_ "go.wit.com/dev/andlabs/ui/winmanifest"
)

func (p *node) newButton(n *node) {
	t := p.tk
	newt := new(guiWidget)

	b := ui.NewButton(getString(n.value))
	newt.uiButton = b
	newt.uiControl = b
	newt.parent = t

	b.OnClicked(func(*ui.Button) {
		n.doUserEvent()
	})

	n.tk = newt
	p.place(n)
}
