summaryrefslogtreecommitdiff
path: root/andlabs/action.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-15 16:11:40 -0600
committerJeff Carr <[email protected]>2024-01-15 16:11:40 -0600
commit29c39d7a1cbc1f071fa819e589fa6ed93fcb7d80 (patch)
tree4081338b6e1ed2e1cc26f3153f1eee3070873558 /andlabs/action.go
parent708ea661988fd0e4886fc63f3f6dffe25b6fa276 (diff)
Destroy window and node from binary treev0.12.3
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'andlabs/action.go')
-rw-r--r--andlabs/action.go31
1 files changed, 25 insertions, 6 deletions
diff --git a/andlabs/action.go b/andlabs/action.go
index a8c783f..b1046ba 100644
--- a/andlabs/action.go
+++ b/andlabs/action.go
@@ -2,7 +2,7 @@ package main
import (
"strconv"
- "github.com/andlabs/ui"
+ "go.wit.com/dev/andlabs/ui"
"go.wit.com/log"
"go.wit.com/gui/widget"
@@ -55,13 +55,13 @@ func (n *node) pad(b bool) {
}
switch n.WidgetType {
- case widget.Group:
- t.uiGroup.SetMargined(b)
- case widget.Tab:
- tabSetMargined(t.uiTab, b)
case widget.Window:
t.uiWindow.SetMargined(b)
t.uiWindow.SetBorderless(b)
+ case widget.Tab:
+ tabSetMargined(t.uiTab, b)
+ case widget.Group:
+ t.uiGroup.SetMargined(b)
case widget.Grid:
t.uiGrid.SetPadded(b)
case widget.Box:
@@ -101,13 +101,32 @@ func (n *node) Delete() {
p := n.parent
log.Log(NOW, "uiDelete()", n.WidgetId, "to", p.WidgetId)
+ if n.WidgetType == widget.Window {
+ log.Warn("DESTROY uiWindow here")
+ log.Warn("NEED TO REMOVE n from parent.Children")
+ n.tk.uiWindow.Destroy()
+ n.tk.uiWindow = nil
+ for i, child := range p.children {
+ log.Warn("parent has child:", i, child.WidgetId, child.progname)
+ if n == child {
+ log.Warn("Found child ==", i, child.WidgetId, child.progname)
+ log.Warn("Found n ==", i, n.WidgetId, n.progname)
+ p.children = append(p.children[:i], p.children[i+1:]...)
+ }
+ // t.uiWindow.SetBorderless(false)
+ }
+ for i, child := range p.children {
+ log.Warn("parent now has child:", i, child.WidgetId, child.progname)
+ }
+ return
+ }
+
switch p.WidgetType {
case widget.Group:
// tParent.uiGroup.SetMargined(true)
case widget.Tab:
// tabSetMargined(tParent.uiTab, true)
case widget.Window:
- // t.uiWindow.SetBorderless(false)
case widget.Grid:
// t.uiGrid.SetPadded(true)
case widget.Box: