summaryrefslogtreecommitdiff
path: root/andlabs/slider.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-17 21:31:49 -0600
committerJeff Carr <[email protected]>2024-01-17 21:31:49 -0600
commit841e6252c95244f0ee7faf2c01d33f69a8ab483a (patch)
treeef400228622b87611168db2227269ba7fd56625d /andlabs/slider.go
parentba95c13799740b5f55541fc5e8ab9f1d34f7e421 (diff)
common tree package for toolkitsv0.12.4
This update provides *lots* of toolkit updates. This will allow the next step of debugging the gocui toolkit to make it work again. There are new common routines for handling the plugin channel communication Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'andlabs/slider.go')
-rw-r--r--andlabs/slider.go19
1 files changed, 13 insertions, 6 deletions
diff --git a/andlabs/slider.go b/andlabs/slider.go
index 0da06f3..5ce393a 100644
--- a/andlabs/slider.go
+++ b/andlabs/slider.go
@@ -1,22 +1,29 @@
package main
import (
+ "go.wit.com/gui/toolkits/tree"
+
"go.wit.com/dev/andlabs/ui"
_ "go.wit.com/dev/andlabs/ui/winmanifest"
)
-func (p *node) newSlider(n *node) {
+func newSlider(p, n *tree.Node) {
+ if notNew(n) { return }
newt := new(guiWidget)
- s := ui.NewSlider(n.X, n.Y)
+ var x, y int
+ x = n.State.Range.Low
+ y = n.State.Range.High
+
+ s := ui.NewSlider(x, y)
newt.uiSlider = s
newt.uiControl = s
s.OnChanged(func(spin *ui.Slider) {
- n.value = newt.uiSlider.Value()
- n.doUserEvent()
+ n.SetValue(newt.uiSlider.Value())
+ me.myTree.DoUserEvent(n)
})
- n.tk = newt
- p.place(n)
+ n.TK = newt
+ place(p, n)
}