summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/slider.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-03-01 11:35:36 -0600
committerJeff Carr <[email protected]>2023-03-01 11:35:36 -0600
commit8dbf5a09097b7868e9218bf98716c57eac998a10 (patch)
treeab3bdfeaf5a59a55de9d2a6661d2d824090491e5 /toolkit/andlabs/slider.go
parentf3bb68396afa7452ecf1c8d4744c825a9d81057c (diff)
lots cleaner code between the pluginv0.6.1
Queue() around SetText is helping userspace crashing merge forceDump(bool) into Dump() debugging output configuration is pretty clean keep cutting down duplicate things --gui-verbose flag works make label "standard" code add debug.FreeOSMemory() move the GO language internals to display in the GUI update push to do tags and go to github.com/wit-go/ remove the other license file it might be confusing golang.org and github proper WidgetType added a Quit() button Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/slider.go')
-rw-r--r--toolkit/andlabs/slider.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/toolkit/andlabs/slider.go b/toolkit/andlabs/slider.go
index 4857935..87639ca 100644
--- a/toolkit/andlabs/slider.go
+++ b/toolkit/andlabs/slider.go
@@ -7,31 +7,32 @@ import (
_ "github.com/andlabs/ui/winmanifest"
)
-func (t andlabsT) NewSlider(title string, x int, y int) *andlabsT {
+func (t andlabsT) newSlider(w *toolkit.Widget) *andlabsT {
// make new node here
- log(debugToolkit, "gui.Toolkit.NewSpinbox()", x, y)
+ log(debugToolkit, w.Name, w.Type, w.X, w.Y)
var newt andlabsT
if (t.uiBox == nil) {
- log(debugToolkit, "gui.ToolkitNode.NewGroup() node.UiBox == nil. I can't add a range UI element without a place to put it")
+ log(debugToolkit, "node.UiBox == nil. I can't add a range UI element without a place to put it")
log(debugToolkit, "probably could just make a box here?")
exit("internal golang wit/gui/toolkit error")
return nil
}
- s := ui.NewSlider(x, y)
+ s := ui.NewSlider(w.X, w.Y)
newt.uiSlider = s
newt.uiBox = t.uiBox
+ newt.tw = w
t.uiBox.Append(s, stretchy)
s.OnChanged(func(spin *ui.Slider) {
- newt.commonChange("Slider")
+ newt.commonChange(newt.tw)
})
return &newt
}
-func NewSlider(parentW *toolkit.Widget, w *toolkit.Widget) {
+func newSlider(parentW *toolkit.Widget, w *toolkit.Widget) {
var newt *andlabsT
log(debugToolkit, "gui.andlabs.NewTab()", w.Name)
@@ -40,6 +41,6 @@ func NewSlider(parentW *toolkit.Widget, w *toolkit.Widget) {
log(debugToolkit, "go.andlabs.NewTab() toolkit struct == nil. name=", parentW.Name, w.Name)
return
}
- newt = t.NewSlider(w.Name, w.X, w.Y)
+ newt = t.newSlider(w)
mapWidgetsToolkits(w, newt)
}