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 <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-26 11:18:01 -06:00
parent c017dc9be0
commit 8a497bf538
5 changed files with 16 additions and 9 deletions

View File

@ -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)
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))
}

5
add.go
View File

@ -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
}

View File

@ -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")

2
go.mod
View File

@ -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

4
go.sum
View File

@ -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=