summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-18 15:39:28 -0600
committerJeff Carr <[email protected]>2025-02-19 17:39:45 -0600
commitad299911f176735ffc039019ff98222525ed9d98 (patch)
treef0c6a693d36faa5506bc0493b33b00f53a04a4bb
parent3d1bb9680a3261a64910c9f9a30034fd16c9e433 (diff)
delete from the gocui binary tree
-rw-r--r--table.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/table.go b/table.go
index 858941b..0d97562 100644
--- a/table.go
+++ b/table.go
@@ -4,6 +4,8 @@
package main
import (
+ "slices"
+
"go.wit.com/lib/protobuf/guipb"
"go.wit.com/log"
"go.wit.com/toolkits/tree"
@@ -36,4 +38,16 @@ func hideWidget(n *tree.Node) {
tk.hideWidgets()
}
tk.Hide()
+ tk.deleteWidget()
+}
+
+func (tk *guiWidget) deleteWidget() {
+ log.Info("gocui deleteWidget() looking for child to delete:", tk.cuiName)
+ p := tk.parent
+ for i, child := range p.children {
+ if tk == child {
+ log.Info("deleteWidget() found parent with child to delete:", i, child.cuiName)
+ p.children = slices.Delete(p.children, i, i+1)
+ }
+ }
}