summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/debug.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-03-03 14:41:38 -0600
committerJeff Carr <[email protected]>2023-03-03 14:41:38 -0600
commit49202eeafdad8e5780fefdad3d2f87fd4354725e (patch)
tree5d749b5d4835c7a0395bd1f87b5d2d1d91b14a08 /toolkit/andlabs/debug.go
parent80317ec89c94beadcbf3775f84c6010b5ceef302 (diff)
release as v0.6.5v0.6.5
good standard release really clean interaction to plugin really clean debug flags implementation common doAppend() idea, but it probably won't work re-implement combobox. this code base almost doesn't suck slider & spinner set values now tab set margin works convert dropdown to Send() lots of other changes to try to implement single line Entry() I guess use golang file names even though internalally the go developers use underscore chars in the actual go sources. Maybe there is a reason for that? go channel debug window does something make a debug window for channels. add sample icons Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/debug.go')
-rw-r--r--toolkit/andlabs/debug.go102
1 files changed, 12 insertions, 90 deletions
diff --git a/toolkit/andlabs/debug.go b/toolkit/andlabs/debug.go
index befbaa0..8b11f8c 100644
--- a/toolkit/andlabs/debug.go
+++ b/toolkit/andlabs/debug.go
@@ -2,7 +2,7 @@ package main
import "git.wit.org/wit/gui/toolkit"
-import "github.com/davecgh/go-spew/spew"
+// import "github.com/davecgh/go-spew/spew"
var defaultBehavior bool = true
@@ -16,6 +16,7 @@ var margin bool // add space around the frames of windows
var debugToolkit bool
var debugChange bool
var debugPlugin bool
+var debugFlag bool
var debugError bool = true
// var DebugToolkit bool
@@ -36,6 +37,7 @@ func setDefaultBehavior(s bool) {
}
}
+/*
func SetDebugToolkit (s bool) {
debugToolkit = s
log(true, "debugToolkit =", debugToolkit)
@@ -47,98 +49,12 @@ func SetDebugChange (s bool) {
log(true, "debugToolkit =", debugToolkit)
log(true, "debugChange =", debugChange)
}
+*/
func ShowDebug () {
log(true, "debugToolkit =", debugToolkit)
- log(true, "debugChange =", debugChange)
-}
-
-func GetDebugToolkit () bool {
- return debugToolkit
-}
-
-func (t *andlabsT) String() string {
- return t.GetText()
-}
-
-func (t *andlabsT) GetText() string {
- log(debugToolkit, "GetText() Enter debugToolkit=", debugToolkit)
- if (t.uiEntry != nil) {
- log(debugToolkit, "uiEntry.Text() =", t.uiEntry.Text())
- return t.uiEntry.Text()
- }
- if (t.uiMultilineEntry != nil) {
- log(debugToolkit, "uiMultilineEntry.Text() =", t.uiMultilineEntry.Text())
- text := t.uiMultilineEntry.Text()
- log(debugToolkit, "uiMultilineEntry.Text() =", text)
- t.text = text
- return text
- }
- if (t.uiCombobox != nil) {
- log(debugToolkit, "uiCombobox() =", t.text)
- return t.text
- }
- return ""
-}
-
-func (t *andlabsT) SetText(s string) bool {
- log(debugToolkit, "Text() SetText() Enter")
- if (t.uiEntry != nil) {
- log(debugToolkit, "Value() =", t.uiEntry.Text)
- t.uiEntry.SetText(s)
- return true
- }
- if (t.uiMultilineEntry != nil) {
- log(debugToolkit, "Value() =", t.uiMultilineEntry.Text)
- t.uiMultilineEntry.SetText(s)
- return true
- }
- return false
-}
-
-func sanity(t *andlabsT) bool {
- if (debugToolkit) {
- log(debugToolkit, "Value() Enter")
- scs := spew.ConfigState{MaxDepth: 1}
- scs.Dump(t)
- }
- if (t.uiEntry == nil) {
- log(debugToolkit, "Value() =", t.uiEntry.Text)
- return false
- }
- return true
-}
-
-func (t *andlabsT) SetValue(i int) bool {
- log(debugToolkit, "SetValue() START")
- if (sanity(t)) {
- return false
- }
- t.Dump(debugToolkit)
- // panic("got to toolkit.SetValue")
- return true
-}
-
-func (t *andlabsT) Value() int {
- if (debugToolkit) {
- log(debugToolkit, "Value() Enter")
- scs := spew.ConfigState{MaxDepth: 1}
- scs.Dump(t)
- }
- if (t == nil) {
- log(debugToolkit, "Value() can not get value t == nil")
- return 0
- }
- if (t.uiSlider != nil) {
- log(debugToolkit, "Value() =", t.uiSlider.Value)
- return t.uiSlider.Value()
- }
- if (t.uiSpinbox != nil) {
- log(debugToolkit, "Value() =", t.uiSpinbox.Value)
- return t.uiSpinbox.Value()
- }
- log(debugToolkit, "Value() Could not find a ui element to get a value from")
- return 0
+ log(true, "debugError =", debugError)
+ log(true, "debugChange =", debugChange)
}
func (t *andlabsT) Dump(b bool) {
@@ -196,3 +112,9 @@ func widgetDump(b bool, w *toolkit.Widget) {
log(b, "widget.X =", w.X)
log(b, "widget.Y =", w.Y)
}
+
+/*
+func GetDebugToolkit () bool {
+ return debugToolkit
+}
+*/