correctly delete window gocui views
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
e4339f33ac
commit
11ebc77505
13
plugin.go
13
plugin.go
|
@ -105,6 +105,18 @@ func action(a widget.Action) {
|
||||||
log.Log(INFO, "action() END")
|
log.Log(INFO, "action() END")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (w *guiWidget) deleteGocuiViews() {
|
||||||
|
if w.v == nil {
|
||||||
|
// no gocui view to delete for this widget
|
||||||
|
} else {
|
||||||
|
me.baseGui.DeleteView(w.cuiName)
|
||||||
|
w.v = nil
|
||||||
|
}
|
||||||
|
for _, child := range w.children {
|
||||||
|
child.deleteGocuiViews()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (w *guiWidget) deleteNode() {
|
func (w *guiWidget) deleteNode() {
|
||||||
p := w.parent
|
p := w.parent
|
||||||
for i, child := range p.children {
|
for i, child := range p.children {
|
||||||
|
@ -118,6 +130,7 @@ func (w *guiWidget) deleteNode() {
|
||||||
for i, child := range p.children {
|
for i, child := range p.children {
|
||||||
log.Log(NOW, "parent now has child:", i, child.cuiName, child.String())
|
log.Log(NOW, "parent now has child:", i, child.cuiName, child.String())
|
||||||
}
|
}
|
||||||
|
w.deleteGocuiViews()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *guiWidget) AddText(text string) {
|
func (w *guiWidget) AddText(text string) {
|
||||||
|
|
Loading…
Reference in New Issue