From 8a497bf53877c8920f8c3784889117c323d6a597 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 26 Jan 2024 11:18:01 -0600 Subject: [PATCH] new gui release more quiet output allow disabling of more errors sets the text on window open checkbox state works Signed-off-by: Jeff Carr --- action.go | 12 +++++++----- add.go | 5 +++++ flags.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/action.go b/action.go index be97097..2b4c71e 100644 --- a/action.go +++ b/action.go @@ -199,7 +199,7 @@ func processAction(a *widget.Action) { if a.ActionType == widget.Add { n := add(a) - show(n, n.State.Visable) + show(n, ! a.State.Hidden) // pad(n, n.State.Pad) // expand(n, a.State.Expand) return @@ -217,10 +217,12 @@ func processAction(a *widget.Action) { return } log.Error(errors.New("andlabs processAction() ERROR findWidgetId found nil"), a.ActionType, a.WidgetType) - log.Log(NOW, "processAction() ERROR findWidgetId found nil for id =", a.WidgetId) - log.Log(NOW, "processAction() ERROR findWidgetId found nil", a.ActionType, a.WidgetType) - log.Log(NOW, "processAction() ERROR findWidgetId found nil for id =", a.WidgetId) - me.treeRoot.ListWidgets() + log.Log(WARN, "processAction() ERROR findWidgetId found nil for id =", a.WidgetId) + log.Log(WARN, "processAction() ERROR findWidgetId found nil", a.ActionType, a.WidgetType) + log.Log(WARN, "processAction() ERROR findWidgetId found nil for id =", a.WidgetId) + if WARN.Bool() { + me.treeRoot.ListWidgets() + } return panic("findWidgetId found nil for id = " + string(a.WidgetId)) } diff --git a/add.go b/add.go index 41eb55b..641d16c 100644 --- a/add.go +++ b/add.go @@ -32,16 +32,20 @@ func add(a *widget.Action) *tree.Node { newButton(p, n) case widget.Checkbox: newCheckbox(p, n) + setChecked(n, a.State.Checked) case widget.Spinner: newSpinner(p, n) case widget.Slider: newSlider(p, n) case widget.Dropdown: newDropdown(p, n) + setText(n, a) case widget.Combobox: newCombobox(p, n) + setText(n, a) case widget.Textbox: newTextbox(p, n) + setText(n, a) /* case widget.Image: newImage(p, n) @@ -49,5 +53,6 @@ func add(a *widget.Action) *tree.Node { default: log.Log(ERROR, "add() error TODO: ", n.WidgetType, n.State.ProgName) } + return n } diff --git a/flags.go b/flags.go index 54ce34f..0d7785b 100644 --- a/flags.go +++ b/flags.go @@ -25,7 +25,7 @@ func init() { NOW = log.NewFlag("NOW", true, full, short, "temp debugging stuff") INFO = log.NewFlag("INFO", false, full, short, "normal debugging stuff") - WARN = log.NewFlag("WARN", true, full, short, "bad things") + WARN = log.NewFlag("WARN", false, full, short, "bad things") SPEW = log.NewFlag("SPEW", false, full, short, "spew stuff") CHANGE = log.NewFlag("CHANGE", false, full, short, "show when the user does things") diff --git a/go.mod b/go.mod index 5592b92..946a8f4 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( go.wit.com/dev/andlabs/ui v0.0.1 go.wit.com/log v0.5.6 go.wit.com/toolkits/tree v0.13.0 - go.wit.com/widget v1.1.6 + go.wit.com/widget v1.1.7 ) require go.wit.com/dev/davecgh/spew v1.1.4 // indirect diff --git a/go.sum b/go.sum index 28a167c..cd1d7cf 100644 --- a/go.sum +++ b/go.sum @@ -6,5 +6,5 @@ go.wit.com/log v0.5.6 h1:rDC3ju95zfEads4f1Zm+QMkqjZ39CsYAT/UmQQs7VP4= go.wit.com/log v0.5.6/go.mod h1:BaJBfHFqcJSJLXGQ9RHi3XVhPgsStxSMZRlaRxW4kAo= go.wit.com/toolkits/tree v0.13.0 h1:9HvZVKADIBdUC9b36K0WcMKoWxZeptIxDP0YnLh4rtg= go.wit.com/toolkits/tree v0.13.0/go.mod h1:G5OJt3Tv2OBbpEHDQ1f8KVmJYTw7ZS67/nnkkmgBu9c= -go.wit.com/widget v1.1.6 h1:av2miF5vlohMfARA/QGPTPfgW/ADup1c+oeAOKgroPY= -go.wit.com/widget v1.1.6/go.mod h1:I8tnD3x3ECbB/CRNnLCdC+uoyk7rK0AEkzK1bQYSqoQ= +go.wit.com/widget v1.1.7 h1:Gy84I2bD8CMna7NcKBX4sRLR8do6x6mVYX0Ui43f3is= +go.wit.com/widget v1.1.7/go.mod h1:I8tnD3x3ECbB/CRNnLCdC+uoyk7rK0AEkzK1bQYSqoQ=