debian/andlabs/button.go

26 lines
381 B
Go
Raw Normal View History

2024-01-01 16:11:54 -06:00
package main
import (
"go.wit.com/gui/widget"
"go.wit.com/dev/andlabs/ui"
_ "go.wit.com/dev/andlabs/ui/winmanifest"
2024-01-01 16:11:54 -06:00
)
func (p *node) newButton(n *node) {
t := p.tk
newt := new(guiWidget)
b := ui.NewButton(widget.GetString(n.value))
2024-01-01 16:11:54 -06:00
newt.uiButton = b
newt.uiControl = b
newt.parent = t
b.OnClicked(func(*ui.Button) {
n.doUserEvent()
})
n.tk = newt
p.place(n)
}