diff options
| author | Jeff Carr <[email protected]> | 2022-11-05 10:19:04 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2022-11-05 10:19:04 -0500 |
| commit | 099efb6b24caf9eaad50d7386636a7ac23552bde (patch) | |
| tree | 215685d7153e6d002c921d4f7ad2fa12d52fe323 /toolkit/andlabs/common.go | |
| parent | a72d0ab2d0ff58704cc28993ea428b8c6c8825d7 (diff) | |
v0.4.2 more code cleanups and improvementsv0.4.2
Add command line argv handling using go-arg
make hello world dumb stupid simple again
more swtiching to common code
move debugging options to support go-args
more debugging output cleanup
more debugging cleanups
fix null pointer crash
Diffstat (limited to 'toolkit/andlabs/common.go')
| -rw-r--r-- | toolkit/andlabs/common.go | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/toolkit/andlabs/common.go b/toolkit/andlabs/common.go index 75f7444..569621d 100644 --- a/toolkit/andlabs/common.go +++ b/toolkit/andlabs/common.go @@ -12,30 +12,38 @@ func init() { func (t Toolkit) commonChange(widget string) { s := t.String() - log.Println("gui.Toolkit.ui.OnChanged() =", s) if (DebugToolkit) { log.Println("gui.Toolkit.ui.OnChanged() =", s) } if (t.OnChanged != nil) { - log.Println("gui.Toolkit.OnChanged() trying to run toolkit.OnChanged() entered val =", s) + if (DebugToolkit) { + log.Println("gui.Toolkit.OnChanged() trying to run toolkit.OnChanged() entered val =", s) + } t.OnChanged(&t) return } if (t.Custom != nil) { - log.Println("gui.Toolkit.OnChanged() Running toolkit.Custom()") - t.Dump() + if (DebugToolkit) { + log.Println("gui.Toolkit.OnChanged() Running toolkit.Custom()") + t.Dump() + } t.Custom() return } - log.Println("gui.Toolkit.OnChanged() ENDED without finding any callback") + if (DebugToolkit) { + log.Println("gui.Toolkit.OnChanged() ENDED without finding any callback") + } } +// does some sanity checks on the internal structs of the binary tree +// TODO: probably this should not panic unless it's running in devel mode (?) func (t Toolkit) broken() bool { if (t.uiBox == nil) { log.Println("gui.Toolkit.UiBox == nil. I can't add a widget without a place to put it") // log.Println("probably could just make a box here?") // corruption or something horrible? panic("wit/gui toolkit/andlabs func broken() invalid goroutine access into this toolkit?") + panic("wit/gui toolkit/andlabs func broken() this probably should not cause the app to panic here (?)") return true } if (t.uiWindow == nil) { |
