2022-11-14 14:30:28 -06:00
|
|
|
package main
|
2022-10-20 06:55:42 -05:00
|
|
|
|
|
|
|
import "github.com/andlabs/ui"
|
|
|
|
import _ "github.com/andlabs/ui/winmanifest"
|
|
|
|
|
2022-11-14 14:30:28 -06:00
|
|
|
func (t andlabsT) NewSpinner(title string, x int, y int) *andlabsT {
|
2022-10-20 06:55:42 -05:00
|
|
|
// make new node here
|
2023-02-25 14:05:25 -06:00
|
|
|
log(debugToolkit, "gui.Toolkit.NewSpinner()", x, y)
|
2022-11-14 14:30:28 -06:00
|
|
|
var newt andlabsT
|
2022-10-20 06:55:42 -05:00
|
|
|
|
|
|
|
if (t.uiBox == nil) {
|
2023-02-25 14:05:25 -06:00
|
|
|
log(debugToolkit, "gui.ToolkitNode.NewSpinner() node.UiBox == nil. I can't add a range UI element without a place to put it")
|
|
|
|
exit("internal golang wit/gui error")
|
2022-10-20 06:55:42 -05:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
s := ui.NewSpinbox(x, y)
|
|
|
|
newt.uiSpinbox = s
|
|
|
|
newt.uiBox = t.uiBox
|
2022-10-21 11:40:08 -05:00
|
|
|
t.uiBox.Append(s, stretchy)
|
2022-10-20 06:55:42 -05:00
|
|
|
|
|
|
|
s.OnChanged(func(s *ui.Spinbox) {
|
2022-11-05 10:19:04 -05:00
|
|
|
newt.commonChange("Spinner")
|
2022-10-20 06:55:42 -05:00
|
|
|
})
|
|
|
|
|
|
|
|
return &newt
|
|
|
|
}
|