debian/andlabs/slider.go

23 lines
349 B
Go
Raw Normal View History

2024-01-01 16:11:54 -06:00
package main
import (
"go.wit.com/dev/andlabs/ui"
_ "go.wit.com/dev/andlabs/ui/winmanifest"
2024-01-01 16:11:54 -06:00
)
func (p *node) newSlider(n *node) {
newt := new(guiWidget)
s := ui.NewSlider(n.X, n.Y)
newt.uiSlider = s
newt.uiControl = s
s.OnChanged(func(spin *ui.Slider) {
n.value = newt.uiSlider.Value()
2024-01-01 16:11:54 -06:00
n.doUserEvent()
})
n.tk = newt
p.place(n)
}