summaryrefslogtreecommitdiff
path: root/andlabs/slider.go
blob: 0da06f3331e8f18d8c2991ce2a8524edcbacc193 (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 (
	"go.wit.com/dev/andlabs/ui"
	_ "go.wit.com/dev/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.value = newt.uiSlider.Value()
		n.doUserEvent()
	})

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