diff options
| author | Jeff Carr <[email protected]> | 2023-03-01 11:35:36 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-03-01 11:35:36 -0600 |
| commit | 8dbf5a09097b7868e9218bf98716c57eac998a10 (patch) | |
| tree | ab3bdfeaf5a59a55de9d2a6661d2d824090491e5 /toolkit/andlabs/spinner.go | |
| parent | f3bb68396afa7452ecf1c8d4744c825a9d81057c (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/spinner.go')
| -rw-r--r-- | toolkit/andlabs/spinner.go | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/toolkit/andlabs/spinner.go b/toolkit/andlabs/spinner.go index b98fb0c..1a7430e 100644 --- a/toolkit/andlabs/spinner.go +++ b/toolkit/andlabs/spinner.go @@ -1,27 +1,43 @@ package main -import "github.com/andlabs/ui" -import _ "github.com/andlabs/ui/winmanifest" +import ( + "git.wit.org/wit/gui/toolkit" -func (t andlabsT) NewSpinner(title string, x int, y int) *andlabsT { + "github.com/andlabs/ui" + _ "github.com/andlabs/ui/winmanifest" +) + +func (t andlabsT) newSpinner(w *toolkit.Widget) *andlabsT { // make new node here - log(debugToolkit, "gui.Toolkit.NewSpinner()", x, y) + log(debugToolkit, "newSpinner()", w.X, w.Y) var newt andlabsT if (t.uiBox == nil) { - 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") + log(debugToolkit, "newSpinner() node.UiBox == nil. I can't add a range UI element without a place to put it") return nil } - s := ui.NewSpinbox(x, y) + s := ui.NewSpinbox(w.X, w.Y) newt.uiSpinbox = s newt.uiBox = t.uiBox + newt.tw = w t.uiBox.Append(s, stretchy) s.OnChanged(func(s *ui.Spinbox) { - newt.commonChange("Spinner") + newt.commonChange(newt.tw) }) return &newt } + +func newSpinner(parentW *toolkit.Widget, w *toolkit.Widget) { + var newt *andlabsT + + t := mapToolkits[parentW] + if (t == nil) { + log(debugToolkit, "go.andlabs.NewTab() toolkit struct == nil. name=", parentW.Name, w.Name) + return + } + newt = t.newSpinner(w) + mapWidgetsToolkits(w, newt) +} |
