summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/spinner.go
blob: b7d5947474d801befa99d9de29639af1e4778cc4 (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) newSpinner(n *node) {
	newt := new(andlabsT)

	s := ui.NewSpinbox(n.X, n.Y)
	newt.uiSpinbox = s
	newt.uiControl = s

	s.OnChanged(func(s *ui.Spinbox) {
		n.I = newt.uiSpinbox.Value()
		n.doUserEvent()
	})

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