blob: 3f920678cecd4358901ebe64aa8317c379e68926 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
package main
import (
"git.wit.org/wit/gui/toolkit"
"github.com/andlabs/ui"
_ "github.com/andlabs/ui/winmanifest"
)
func (t *andlabsT) newSlider(a *toolkit.Action) *andlabsT {
var newt andlabsT
w := a.Widget
s := ui.NewSlider(a.X, a.Y)
newt.uiSlider = s
newt.uiControl = s
newt.tw = w
newt.WidgetType = toolkit.Slider
newt.wId = a.WidgetId
s.OnChanged(func(spin *ui.Slider) {
newt.i = newt.uiSlider.Value()
newt.doUserEvent()
})
return &newt
}
func newSlider(a *toolkit.Action) {
var newt *andlabsT
log(debugToolkit, "newSlider()", a.Name)
t := andlabs[a.ParentId]
if (t == nil) {
log(debugError, "newSlider() ERROR toolkit struct == nil. name=", a.Name)
return
}
newt = t.newSlider(a)
place(a, t, newt)
}
|