summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/slider.go
blob: 16c8a8b8698373f1ebffc7d14f40e1e3e1d1d3e4 (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(andlabsT)

	s := ui.NewSlider(n.X, n.Y)
	newt.uiSlider = s
	newt.uiControl = s

	s.OnChanged(func(spin *ui.Slider) {
		newt.i = newt.uiSlider.Value()
		newt.doUserEvent()
	})

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