nocui works

release automation testing
    try to track disable state

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-27 10:03:01 -06:00
parent fbd035f5be
commit e1cd1a27a3
4 changed files with 29 additions and 17 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.swp

View File

@ -80,6 +80,11 @@ func ready(n *tree.Node) bool {
return true
}
func hide(n *tree.Node) {
show(n, false)
n.State.Hidden = true
}
func show(n *tree.Node, b bool) {
if tkbad(n) {
return
@ -102,14 +107,11 @@ func show(n *tree.Node, b bool) {
}
func enable(n *tree.Node, b bool) {
var tk *guiWidget
tk = n.TK.(*guiWidget)
if n == nil {
panic("WHAT? enable was passed nil. How does this even happen?")
}
if tk == nil {
if !ready(n) {
return
}
var tk *guiWidget
tk = n.TK.(*guiWidget)
if tk.uiControl == nil {
return
}
@ -199,7 +201,16 @@ func processAction(a *widget.Action) {
if a.ActionType == widget.Add {
n := add(a)
show(n, !a.State.Hidden)
// show(n, !a.State.Hidden)
if a.State.Hidden {
hide(n)
} else {
if a.State.Enable {
// nothing to do
} else {
enable(n, false)
}
}
// pad(n, n.State.Pad)
// expand(n, a.State.Expand)
return
@ -238,7 +249,7 @@ func processAction(a *widget.Action) {
case widget.Show:
show(n, true)
case widget.Hide:
show(n, false)
hide(n)
case widget.Enable:
enable(n, true)
case widget.Disable:

6
go.mod
View File

@ -4,9 +4,9 @@ go 1.21.4
require (
go.wit.com/dev/andlabs/ui v0.0.1
go.wit.com/log v0.5.6
go.wit.com/toolkits/tree v0.13.13
go.wit.com/widget v1.1.7
go.wit.com/log v0.13.0
go.wit.com/toolkits/tree v0.13.14
go.wit.com/widget v1.1.8
)
require go.wit.com/dev/davecgh/spew v1.1.4 // indirect

12
go.sum
View File

@ -2,9 +2,9 @@ go.wit.com/dev/andlabs/ui v0.0.1 h1:SowOybLBu/qUOqp905EZikz5/iPa3GpmnCAPzNOYajM=
go.wit.com/dev/andlabs/ui v0.0.1/go.mod h1:mlKEEe05ZJURzjh1LtjzdGMHVbJm9a7BUaVpA9cHxsM=
go.wit.com/dev/davecgh/spew v1.1.4 h1:C9hj/rjlUpdK+E6aroyLjCbS5MFcyNUOuP1ICLWdNek=
go.wit.com/dev/davecgh/spew v1.1.4/go.mod h1:sihvWmnQ/09FWplnEmozt90CCVqBtGuPXM811tgfhFA=
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.13 h1:2/3hTZ7mMxbxsFnIgknySEbTdX/cHxpdHqK5xUoP7fI=
go.wit.com/toolkits/tree v0.13.13/go.mod h1:BUJYvkdwGjuyK987nELtZXyqOf4cbMWx+TV+Kon6MtU=
go.wit.com/widget v1.1.7 h1:Gy84I2bD8CMna7NcKBX4sRLR8do6x6mVYX0Ui43f3is=
go.wit.com/widget v1.1.7/go.mod h1:I8tnD3x3ECbB/CRNnLCdC+uoyk7rK0AEkzK1bQYSqoQ=
go.wit.com/log v0.13.0 h1:0vyW3mHwDww3wCsyGnmQuX2P4V7aBMoJgxCy0GfA20g=
go.wit.com/log v0.13.0/go.mod h1:BaJBfHFqcJSJLXGQ9RHi3XVhPgsStxSMZRlaRxW4kAo=
go.wit.com/toolkits/tree v0.13.14 h1:Hy1tbgSL67rvlXkPCz65CDq03i2VeilL95gtOpkzOpo=
go.wit.com/toolkits/tree v0.13.14/go.mod h1:f9ihlbRaORRqgWiqOslfUbLkFRgIjBWY0nG0MidHC7g=
go.wit.com/widget v1.1.8 h1:5cHcmfgwCyHjf02Af/9UMrbLhBR7Z/LFAjPuCx4dx5A=
go.wit.com/widget v1.1.8/go.mod h1:I8tnD3x3ECbB/CRNnLCdC+uoyk7rK0AEkzK1bQYSqoQ=