summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/slider.go
blob: 50989431324903007eb5bfcdbc5e77f37c2a5ced (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package main

import (
	"github.com/andlabs/ui"
	_ "github.com/andlabs/ui/winmanifest"
)

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.I = newt.uiSlider.Value()
		n.doUserEvent()
	})

	n.tk = newt
	p.place(n)
}