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/slider.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'toolkit/andlabs/slider.go') diff --git a/toolkit/andlabs/slider.go b/toolkit/andlabs/slider.go index f9ff0f3..4857935 100644 --- a/toolkit/andlabs/slider.go +++ b/toolkit/andlabs/slider.go @@ -1,9 +1,6 @@ package main import ( - "log" - "os" - "git.wit.org/wit/gui/toolkit" "github.com/andlabs/ui" @@ -12,13 +9,13 @@ import ( func (t andlabsT) NewSlider(title string, x int, y int) *andlabsT { // make new node here - log.Println("gui.Toolkit.NewSpinbox()", x, y) + log(debugToolkit, "gui.Toolkit.NewSpinbox()", x, y) var newt andlabsT if (t.uiBox == nil) { - log.Println("gui.ToolkitNode.NewGroup() node.UiBox == nil. I can't add a range UI element without a place to put it") - log.Println("probably could just make a box here?") - os.Exit(0) + log(debugToolkit, "gui.ToolkitNode.NewGroup() node.UiBox == nil. I can't add a range UI element without a place to put it") + log(debugToolkit, "probably could just make a box here?") + exit("internal golang wit/gui/toolkit error") return nil } @@ -36,11 +33,11 @@ func (t andlabsT) NewSlider(title string, x int, y int) *andlabsT { func NewSlider(parentW *toolkit.Widget, w *toolkit.Widget) { var newt *andlabsT - log.Println("gui.andlabs.NewTab()", w.Name) + log(debugToolkit, "gui.andlabs.NewTab()", w.Name) t := mapToolkits[parentW] if (t == nil) { - log.Println("go.andlabs.NewTab() toolkit struct == nil. name=", parentW.Name, w.Name) + log(debugToolkit, "go.andlabs.NewTab() toolkit struct == nil. name=", parentW.Name, w.Name) return } newt = t.NewSlider(w.Name, w.X, w.Y) -- cgit v1.2.3