Compare commits

..

No commits in common. "guimaster" and "v0.12.6" have entirely different histories.

7 changed files with 47 additions and 52 deletions

View File

@ -28,6 +28,20 @@ update:
git pull git pull
go get -v -t -u ./... go get -v -t -u ./...
# sync repo to the github backup
# git remote add github git@github.com:wit-go/gui.git
github:
git push origin master
git push origin devel
git push origin --tags
git push github master
git push github devel
git push github --tags
@echo
@echo check https://git.wit.org/gui/gui
@echo check https://github.com/wit-go/gui
@echo
doc: doc:
godoc -v godoc -v

View File

@ -2,7 +2,7 @@ package gui
import ( import (
"go.wit.com/log" "go.wit.com/log"
"go.wit.com/dev/alexflint/arg" "go.wit.com/dev/alexflint/go-arg"
) )
var INFO *log.LogFlag var INFO *log.LogFlag

View File

@ -33,19 +33,13 @@ func (n *Node) Hide() *Node {
if ! n.Ready() { return n } if ! n.Ready() { return n }
if n.Hidden() { return n } if n.Hidden() { return n }
if n.WidgetType == widget.Window { if n.WidgetType == widget.Window {
log.Warn("Hide on a window", n.progname) log.Warn("Hide on a window", n.progname)
log.Warn("this needs to do TestDestroy() ?") log.Warn("this needs to do TestDestroy() ?")
n.Destroy()
n.hidden = true
n.changed = true
return nil
} }
n.hidden = true n.hidden = true
n.changed = true n.changed = true
// inform the toolkits // inform the toolkits
sendAction(n, widget.Hide) sendAction(n, widget.Hide)
return n return n
@ -79,18 +73,6 @@ func (n *Node) Disable() *Node {
return n return n
} }
func (n *Node) Destroy() {
if ! n.Ready() { return }
// if ! n.enabled { return }
n.enabled = false
n.changed = true
// inform the toolkits
sendAction(n, widget.Delete)
return
}
// add a new text string to widgets that support // add a new text string to widgets that support
// multiple string values // multiple string values
@ -146,17 +128,17 @@ func (n *Node) GetBool() bool {
} }
// should get the reference name used for programming and debugging // should get the reference name used for programming and debugging
func (n *Node) SetProgName(s string) *Node { func (n *Node) SetProgName(s string) {
if ! n.Ready() { return n } if ! n.Ready() { return }
if n.progname == s { if n.progname == s {
// don't do anything since nothing changed // don't do anything since nothing changed
return n return
} }
n.changed = true n.changed = true
n.progname = s n.progname = s
return n return
} }
/* /*

10
go.mod
View File

@ -3,12 +3,12 @@ module go.wit.com/gui/gui
go 1.21.4 go 1.21.4
require ( require (
go.wit.com/dev/alexflint/arg v1.4.5 github.com/alexflint/go-arg v1.4.3
go.wit.com/gui/widget v1.1.3 go.wit.com/gui/widget v0.0.0-20240105185907-84aafa536a93
go.wit.com/log v0.5.4 go.wit.com/log v0.3.1
) )
require ( require (
go.wit.com/dev/alexflint/scalar v1.2.1 // indirect github.com/alexflint/go-scalar v1.1.0 // indirect
go.wit.com/dev/davecgh/spew v1.1.4 // indirect go.wit.com/spew v0.0.0-20240101141411-c7b8e91573c9 // indirect
) )

32
go.sum
View File

@ -1,10 +1,22 @@
go.wit.com/dev/alexflint/arg v1.4.5 h1:asDx5f9IlfpknKjPBqqb2qndE91Pbo7ZDkWUgddfMhY= github.com/alexflint/go-arg v1.4.3 h1:9rwwEBpMXfKQKceuZfYcwuc/7YY7tWJbFsgG5cAU/uo=
go.wit.com/dev/alexflint/arg v1.4.5/go.mod h1:wnWc+c6z8kSdDKYriMf6RpM+FiXmo5RYp/t4FNi0MU0= github.com/alexflint/go-arg v1.4.3/go.mod h1:3PZ/wp/8HuqRZMUUgu7I+e1qcpUbvmS258mRXkFH4IA=
go.wit.com/dev/alexflint/scalar v1.2.1 h1:loXOcbVnd+8YeJRLey+XXidecBiedMDO00zQ26TvKNs= github.com/alexflint/go-scalar v1.1.0 h1:aaAouLLzI9TChcPXotr6gUhq+Scr8rl0P9P4PnltbhM=
go.wit.com/dev/alexflint/scalar v1.2.1/go.mod h1:+rYsfxqdI2cwA8kJ7GCMwWbNJvfvWUurOCXLiwdTtSs= github.com/alexflint/go-scalar v1.1.0/go.mod h1:LoFvNMqS1CPrMVltza4LvnGKhaSpc3oyLEBUZVhhS2o=
go.wit.com/dev/davecgh/spew v1.1.4 h1:C9hj/rjlUpdK+E6aroyLjCbS5MFcyNUOuP1ICLWdNek= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
go.wit.com/dev/davecgh/spew v1.1.4/go.mod h1:sihvWmnQ/09FWplnEmozt90CCVqBtGuPXM811tgfhFA= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
go.wit.com/gui/widget v1.1.3 h1:GvLzGSOF9tfmoh6HNbFdN+NSlBo2qeS/Ba2TnQQ1A1U= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
go.wit.com/gui/widget v1.1.3/go.mod h1:A6/FaiFQtAHTjgo7c4FrokXe6bXX1Cowo35b2Lgi31E= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
go.wit.com/log v0.5.4 h1:vijLRPTUgChb8J5tx/7Uma/lGTUxeSXosFbheAmL914= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
go.wit.com/log v0.5.4/go.mod h1:BaJBfHFqcJSJLXGQ9RHi3XVhPgsStxSMZRlaRxW4kAo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
go.wit.com/gui/widget v0.0.0-20240105185907-84aafa536a93 h1:zCzaHvXJJ/rWXmDc/v79VvM6W2lxxzJGfnW2lHCv3Ho=
go.wit.com/gui/widget v0.0.0-20240105185907-84aafa536a93/go.mod h1:A6/FaiFQtAHTjgo7c4FrokXe6bXX1Cowo35b2Lgi31E=
go.wit.com/log v0.3.1 h1:UXtgJ4dwyWL0Yv4mw6gQnlmrIQU/zz6nClCB7NGKBQs=
go.wit.com/log v0.3.1/go.mod h1:GmsggfsKrqdZdAj26fEOlcTz6qEIazbV33uyuuktvB8=
go.wit.com/spew v0.0.0-20240101141411-c7b8e91573c9 h1:UEX2EzLQPzLTfy/kUFQD7OXtvKn8wk/+jpDOkbl4ff4=
go.wit.com/spew v0.0.0-20240101141411-c7b8e91573c9/go.mod h1:qBpgJXThMMT15vym7/E4Ur9y8oOo2nP7t2RP52QHUNw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@ -201,6 +201,7 @@ func initToolkit(name string, filename string) *aplug {
// add it to the list of plugins // add it to the list of plugins
allPlugins = append(allPlugins, newPlug) allPlugins = append(allPlugins, newPlug)
// set the communication to the plugins // set the communication to the plugins
newPlug.pluginChan = newPlug.PluginChannel() newPlug.pluginChan = newPlug.PluginChannel()
if (newPlug.pluginChan == nil) { if (newPlug.pluginChan == nil) {

View File

@ -1,14 +0,0 @@
package gui
import (
"go.wit.com/gui/widget"
)
func (parent *Node) NewSeparator(progname string) *Node {
newNode := parent.newNode(progname, widget.Separator)
newNode.progname = progname
// inform the toolkits
sendAction(newNode, widget.Add)
return newNode
}