From f3bb68396afa7452ecf1c8d4744c825a9d81057c Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 25 Feb 2023 14:05:25 -0600 Subject: 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 --- toolkit/andlabs/textbox.go | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'toolkit/andlabs/textbox.go') diff --git a/toolkit/andlabs/textbox.go b/toolkit/andlabs/textbox.go index c7a9390..cb6075d 100644 --- a/toolkit/andlabs/textbox.go +++ b/toolkit/andlabs/textbox.go @@ -1,7 +1,5 @@ package main -import "log" - import "git.wit.org/wit/gui/toolkit" import "github.com/andlabs/ui" @@ -10,9 +8,7 @@ import _ "github.com/andlabs/ui/winmanifest" func (t andlabsT) NewTextbox(name string) *andlabsT { var newt andlabsT - if (DebugToolkit) { - log.Println("gui.Toolkit.NewTextbox()", name) - } + log(debugToolkit, "gui.Toolkit.NewTextbox()", name) if t.broken() { return nil } @@ -37,11 +33,11 @@ func (t andlabsT) NewTextbox(name string) *andlabsT { func NewTextbox(parentW *toolkit.Widget, w *toolkit.Widget) { var t, newt *andlabsT - log.Println("gui.andlabs.NewTextbox()", w.Name) + log(debugToolkit, "gui.andlabs.NewTextbox()", w.Name) t = mapToolkits[parentW] if (t == nil) { - log.Println("go.andlabs.NewTextbox() toolkit struct == nil. name=", parentW.Name, w.Name) + log(debugToolkit, "go.andlabs.NewTextbox() toolkit struct == nil. name=", parentW.Name, w.Name) return } @@ -53,16 +49,15 @@ func NewTextbox(parentW *toolkit.Widget, w *toolkit.Widget) { newt.uiLabel = ui.NewLabel(w.Name) newt.uiBox = t.uiBox - if (DebugToolkit) { - log.Println("gui.Toolbox.NewTextbox() about to append to Box parent t:", w.Name) - t.Dump() - log.Println("gui.Toolbox.NewTextbox() about to append to Box new t:", w.Name) - newt.Dump() - } + log(debugToolkit, "gui.Toolbox.NewTextbox() about to append to Box parent t:", w.Name) + t.Dump() + log(debugToolkit, "gui.Toolbox.NewTextbox() about to append to Box new t:", w.Name) + newt.Dump() + if (t.uiBox != nil) { t.uiBox.Append(newt.uiLabel, false) } else { - log.Println("ERROR: wit/gui andlabs couldn't place this Textbox in a box") + log(debugToolkit, "ERROR: wit/gui andlabs couldn't place this Textbox in a box") return } -- cgit v1.2.3