diff options
| author | Jeff Carr <[email protected]> | 2023-02-25 14:05:25 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-02-25 14:05:25 -0600 |
| commit | f3bb68396afa7452ecf1c8d4744c825a9d81057c (patch) | |
| tree | 00b55a17cee7a8e2f795c479a84a844779993c1c /toolkit/andlabs/checkbox.go | |
| parent | 355e5ec968427c2b07b78fec12224f31a65df740 (diff) | |
The debugging window is finally useful
the gui enabled debugging works
--gui-debug works from the command line
The debug window can now select things
debugging now includes widget types
all the debug flags work
finally working debugging flags via gui checkboxes
add debian packaging rules
use log() in the toolkit
use a standard log() to simplify debugging flags
add reference to 'GO Style Guide'
use the same LICENSE from the GO developers.
TODO: make this threadsafe
TODO: fix plugin stuff
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/checkbox.go')
| -rw-r--r-- | toolkit/andlabs/checkbox.go | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/toolkit/andlabs/checkbox.go b/toolkit/andlabs/checkbox.go index b4b1524..5466d17 100644 --- a/toolkit/andlabs/checkbox.go +++ b/toolkit/andlabs/checkbox.go @@ -1,12 +1,12 @@ package main -import "log" +import "git.wit.org/wit/gui/toolkit" import "github.com/andlabs/ui" import _ "github.com/andlabs/ui/winmanifest" -func (t andlabsT) NewCheckbox(name string) *andlabsT { - log.Println("gui.Toolkit.NewCheckbox()", name) +func (t andlabsT) NewCheckbox(name string, f func()) *andlabsT { + log(debugToolkit, "gui.Toolkit.NewCheckbox()", name) var newt andlabsT if t.broken() { @@ -17,9 +17,20 @@ func (t andlabsT) NewCheckbox(name string) *andlabsT { newt.uiCheckbox = c newt.uiBox = t.uiBox t.uiBox.Append(c, stretchy) + // newt.Custom = f c.OnToggled(func(spin *ui.Checkbox) { + // log(debugToolkit, "gui.Toolkit.NewCheckbox() clicked", name) newt.commonChange("Checkbox") + /* + if (f != nil) { + log(debugToolkit, "Run custom() here", f) + log(SPEW, f) + f() + } else { + log(debugToolkit, "No custom() function here") + } + */ }) return &newt @@ -32,3 +43,27 @@ func (t andlabsT) Checked() bool { return t.uiCheckbox.Checked() } + +func NewCheckbox(parentW *toolkit.Widget, w *toolkit.Widget) { + log(debugToolkit, "gui.andlabs.NewCheckbox()", w.Name) + + t := mapToolkits[parentW] + if (t == nil) { + listMap() + } + newt := t.NewCheckbox(w.Name, w.Custom) + newt.Custom = w.Custom + /* + if (w.Custom != nil) { + log(true, "go.andlabs.NewCheckbox() toolkit struct == nil. name=", parentW.Name, w.Name) + log(true, "Run custom() START here", w.Custom) + w.Custom() + log(true, "Run custom() END") + // exit("ran it here") + } else { + log(true, "No custom() function here") + // exit("nothing here") + } + */ + mapWidgetsToolkits(w, newt) +} |
