2024-01-01 16:11:54 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/andlabs/ui"
|
|
|
|
_ "github.com/andlabs/ui/winmanifest"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (p *node) newCheckbox(n *node) {
|
|
|
|
newt := new(guiWidget)
|
|
|
|
|
2024-01-11 17:19:47 -06:00
|
|
|
newt.uiCheckbox = ui.NewCheckbox(n.label)
|
2024-01-01 16:11:54 -06:00
|
|
|
newt.uiControl = newt.uiCheckbox
|
|
|
|
|
|
|
|
newt.uiCheckbox.OnToggled(func(spin *ui.Checkbox) {
|
2024-01-11 17:19:47 -06:00
|
|
|
n.value = newt.checked()
|
2024-01-01 16:11:54 -06:00
|
|
|
n.doUserEvent()
|
|
|
|
})
|
|
|
|
|
|
|
|
n.tk = newt
|
|
|
|
p.place(n)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *guiWidget) checked() bool {
|
|
|
|
return t.uiCheckbox.Checked()
|
|
|
|
}
|