2022-10-16 08:07:13 -05:00
|
|
|
package gui
|
|
|
|
|
|
|
|
import "log"
|
|
|
|
|
|
|
|
import toolkit "git.wit.org/wit/gui/toolkit/andlabs"
|
|
|
|
|
|
|
|
func (n *Node) NewSlider(name string, x int, y int) *Node {
|
2022-10-19 13:23:22 -05:00
|
|
|
var newT *toolkit.Toolkit
|
|
|
|
var sNode *Node
|
2022-10-16 08:07:13 -05:00
|
|
|
|
2022-10-19 13:23:22 -05:00
|
|
|
log.Println("toolkit.NewSlider() START", name)
|
2022-10-16 08:07:13 -05:00
|
|
|
|
2022-10-21 11:40:08 -05:00
|
|
|
n.verify()
|
2022-10-16 08:07:13 -05:00
|
|
|
|
2022-10-19 13:23:22 -05:00
|
|
|
// make a *Node with a *toolkit.Group
|
|
|
|
sNode = n.New(name + " part1")
|
2022-10-20 06:55:42 -05:00
|
|
|
newT = n.toolkit.NewSlider(name, x, y)
|
2022-10-19 13:23:22 -05:00
|
|
|
newT.Name = name
|
2022-10-20 06:55:42 -05:00
|
|
|
sNode.custom = n.custom
|
|
|
|
newT.Custom = func () {
|
2022-10-21 11:40:08 -05:00
|
|
|
commonCallback(sNode)
|
2022-10-20 06:55:42 -05:00
|
|
|
}
|
|
|
|
sNode.toolkit = newT
|
2022-10-19 13:23:22 -05:00
|
|
|
sNode.Dump()
|
2022-10-20 06:55:42 -05:00
|
|
|
// panic("checking Custom()")
|
2022-10-19 13:23:22 -05:00
|
|
|
|
|
|
|
return sNode
|
2022-10-16 08:07:13 -05:00
|
|
|
}
|