summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/slider.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-27 10:24:52 -0500
committerJeff Carr <[email protected]>2023-04-27 10:24:52 -0500
commite3dbd4b2074c80cc089e54495ff2df3f94afabab (patch)
treecf5a4ce117ad2861041df8df579027ab0d1d578e /toolkit/andlabs/slider.go
parentd5d11d9ca9c69e01715d191eb63ead18d8d7ff05 (diff)
andlabs: more things in the binary tree
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/slider.go')
-rw-r--r--toolkit/andlabs/slider.go26
1 files changed, 5 insertions, 21 deletions
diff --git a/toolkit/andlabs/slider.go b/toolkit/andlabs/slider.go
index 821fa7b..16c8a8b 100644
--- a/toolkit/andlabs/slider.go
+++ b/toolkit/andlabs/slider.go
@@ -1,38 +1,22 @@
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
+func (p *node) newSlider(n *node) {
+ newt := new(andlabsT)
- s := ui.NewSlider(a.X, a.Y)
+ s := ui.NewSlider(n.X, n.Y)
newt.uiSlider = s
newt.uiControl = s
- 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)
+ n.tk = newt
+ p.place(n)
}