2022-11-14 14:30:28 -06:00
|
|
|
package main
|
2022-10-16 08:07:13 -05:00
|
|
|
|
2022-11-14 14:30:28 -06:00
|
|
|
import (
|
|
|
|
"github.com/andlabs/ui"
|
|
|
|
_ "github.com/andlabs/ui/winmanifest"
|
|
|
|
)
|
|
|
|
|
2023-04-27 10:24:52 -05:00
|
|
|
func (p *node) newSlider(n *node) {
|
|
|
|
newt := new(andlabsT)
|
2022-10-16 08:07:13 -05:00
|
|
|
|
2023-04-27 10:24:52 -05:00
|
|
|
s := ui.NewSlider(n.X, n.Y)
|
2022-10-19 13:23:22 -05:00
|
|
|
newt.uiSlider = s
|
2023-03-23 12:35:12 -05:00
|
|
|
newt.uiControl = s
|
2022-10-16 08:07:13 -05:00
|
|
|
|
|
|
|
s.OnChanged(func(spin *ui.Slider) {
|
2023-04-27 12:41:42 -05:00
|
|
|
n.I = newt.uiSlider.Value()
|
|
|
|
n.doUserEvent()
|
2022-10-16 08:07:13 -05:00
|
|
|
})
|
|
|
|
|
2023-04-27 10:24:52 -05:00
|
|
|
n.tk = newt
|
|
|
|
p.place(n)
|
2023-03-12 08:47:16 -05:00
|
|
|
}
|