summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/slider.go
blob: f1b4676451c79726f95ffcfbd0eb1f6a79c96dac (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) {
		n.I = newt.uiSlider.Value()
		n.doUserEvent()
	})

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