26 lines
432 B
Go
26 lines
432 B
Go
package main
|
|
|
|
import (
|
|
"github.com/andlabs/ui"
|
|
_ "github.com/andlabs/ui/winmanifest"
|
|
)
|
|
|
|
func (p *node) newCheckbox(n *node) {
|
|
newt := new(guiWidget)
|
|
|
|
newt.uiCheckbox = ui.NewCheckbox(n.label)
|
|
newt.uiControl = newt.uiCheckbox
|
|
|
|
newt.uiCheckbox.OnToggled(func(spin *ui.Checkbox) {
|
|
n.value = newt.checked()
|
|
n.doUserEvent()
|
|
})
|
|
|
|
n.tk = newt
|
|
p.place(n)
|
|
}
|
|
|
|
func (t *guiWidget) checked() bool {
|
|
return t.uiCheckbox.Checked()
|
|
}
|