add basic entry widget for testing

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-20 21:22:43 -06:00
parent 826ff28398
commit 99b8797004
4 changed files with 54 additions and 13 deletions

View File

@ -15,7 +15,9 @@ type choices struct {
colors *gui.Node
checkers *gui.Node
socks *gadgets.OneLiner
socks *gadgets.OneLiner
animal *gadgets.BasicCombobox
place *gadgets.BasicEntry
}
// This initializes the first window and some widgets
@ -56,6 +58,14 @@ func newChoices(parent *gui.Node) *choices {
c.socks = gadgets.NewOneLiner(c.grid, "two for one")
c.socks.SetValue("socks")
c.animal = gadgets.NewBasicCombobox(c.grid, "animals")
c.animal.AddText("otter")
c.animal.AddText("honey badger")
c.animal.AddText("polar bear")
c.place = gadgets.NewBasicEntry(c.grid, "favorite place")
c.place.SetText("coffee shop")
return c
}

13
go.mod
View File

@ -3,14 +3,19 @@ module go.wit.com/apps/gadgetwindow
go 1.21.4
require (
go.wit.com/gui v0.12.18
go.wit.com/lib/gadgets v0.12.13
go.wit.com/log v0.5.5
go.wit.com/gui v0.12.19
go.wit.com/lib/debugger v0.12.6
go.wit.com/lib/gadgets v0.12.14
go.wit.com/lib/gui/logsettings v0.10.2
go.wit.com/log v0.5.6
)
require (
github.com/sourcegraph/conc v0.3.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
go.wit.com/dev/alexflint/arg v1.4.5 // indirect
go.wit.com/dev/alexflint/scalar v1.2.1 // indirect
go.wit.com/dev/davecgh/spew v1.1.4 // indirect
go.wit.com/widget v1.1.5 // indirect
go.wit.com/widget v1.1.6 // indirect
)

37
go.sum
View File

@ -1,14 +1,35 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
go.wit.com/dev/alexflint/arg v1.4.5 h1:asDx5f9IlfpknKjPBqqb2qndE91Pbo7ZDkWUgddfMhY=
go.wit.com/dev/alexflint/arg v1.4.5/go.mod h1:wnWc+c6z8kSdDKYriMf6RpM+FiXmo5RYp/t4FNi0MU0=
go.wit.com/dev/alexflint/scalar v1.2.1 h1:loXOcbVnd+8YeJRLey+XXidecBiedMDO00zQ26TvKNs=
go.wit.com/dev/alexflint/scalar v1.2.1/go.mod h1:+rYsfxqdI2cwA8kJ7GCMwWbNJvfvWUurOCXLiwdTtSs=
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/gui v0.12.18 h1:gFVDaJFz/Su8JgUd9Oxnb3t+FS+bzy5WJSvGoKVGYZU=
go.wit.com/gui v0.12.18/go.mod h1:27+THr2a84GZ61KKUuN30WYnYoSsBewllUKc+fnWLto=
go.wit.com/lib/gadgets v0.12.13 h1:CEPUa+rH4VjmxtaWWSqvhgGEhpIjq8zuc01FIJ62xfA=
go.wit.com/lib/gadgets v0.12.13/go.mod h1:u+Syal5qdem7fEikOiEJdI+dO2zOybfa6vZ9ptF+bJ8=
go.wit.com/log v0.5.5 h1:bK3b94uVKgev4jB5wg06FnvCFBEapQICTSH2YW+CWr4=
go.wit.com/log v0.5.5/go.mod h1:BaJBfHFqcJSJLXGQ9RHi3XVhPgsStxSMZRlaRxW4kAo=
go.wit.com/widget v1.1.5 h1:jx5hJ2WLZJnCcvMuaLHegzpNlzwo+0kOkzsRkzRiB30=
go.wit.com/widget v1.1.5/go.mod h1:I8tnD3x3ECbB/CRNnLCdC+uoyk7rK0AEkzK1bQYSqoQ=
go.wit.com/gui v0.12.19 h1:OEnsnZnec7Q2jZVjwl413V0wuVAAB4r2mGTY0IouBuw=
go.wit.com/gui v0.12.19/go.mod h1:v2VgnOL3dlZ13KclYeedZ1cd20nQdvwjyJTNKvFX3DA=
go.wit.com/lib/debugger v0.12.6 h1:F6OYQtDOlXUJ9/KeCQSswa+I2OdoQu7PG3rdJIbwS6s=
go.wit.com/lib/debugger v0.12.6/go.mod h1:R5EkxOScFSMiixOOoAVmjKwMAZnQ8Zae1+Ek75rDMnE=
go.wit.com/lib/gadgets v0.12.14 h1:Osh7D8TKJiU5M6tXqERGQwTUt+C5IJ0senkmUAirSek=
go.wit.com/lib/gadgets v0.12.14/go.mod h1:Fxc7F8hGskpkWVAsXKhs4ilqUlAnikVXj4yzumtTYa0=
go.wit.com/lib/gui/logsettings v0.10.2 h1:xRx0AX1V74kC6CIm+ib6C3ziTcbBjR/Ju3rTLEpQMsw=
go.wit.com/lib/gui/logsettings v0.10.2/go.mod h1:v5XUQ6WyNyfScR9oOFhdz8p1wtxCpNWXK3DJ/dbLPVo=
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/widget v1.1.6 h1:av2miF5vlohMfARA/QGPTPfgW/ADup1c+oeAOKgroPY=
go.wit.com/widget v1.1.6/go.mod h1:I8tnD3x3ECbB/CRNnLCdC+uoyk7rK0AEkzK1bQYSqoQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@ -76,6 +76,11 @@ func helloworld() {
log.Info("basic window socks =", section2.socks.String())
})
group.NewButton("show animal", func() {
log.Info("main window animal =", section1.animal.String())
log.Info("basic window animal =", section2.animal.String())
})
group = box.NewGroup("debug")
group.NewButton("debugger", func() {
debugger.DebugWindow()