summaryrefslogtreecommitdiff
path: root/delete.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-19 02:52:57 -0600
committerJeff Carr <[email protected]>2024-01-19 02:52:57 -0600
commitc2a563ae37d11f8374df6c7f00661369f4d5a76f (patch)
tree433cb4dd464882258e04a57330113a9f385a96b4 /delete.go
parentd9a04e92fc4211ae4c68e030a72510caadd4be66 (diff)
cleanups after node work
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'delete.go')
-rw-r--r--delete.go54
1 files changed, 0 insertions, 54 deletions
diff --git a/delete.go b/delete.go
deleted file mode 100644
index ff25d69..0000000
--- a/delete.go
+++ /dev/null
@@ -1,54 +0,0 @@
-package main
-
-// if you include more than just this import
-// then your plugin might be doing something un-ideal (just a guess from 2023/02/27)
-import (
- "go.wit.com/log"
- "go.wit.com/widget"
-)
-
-// delete the child widget from the parent
-// p = parent, c = child
-func (n *node) destroy() {
- pId := n.parent.WidgetId
- cId := n.WidgetId
- log.Log(NOW, "delete()", pId, cId)
-
- pt := n.parent.tk
- ct := n.tk
- if ct == nil {
- log.Log(NOW, "delete FAILED (ct = mapToolkit[c] == nil) for c", pId, cId)
- // this pukes out a whole universe of shit
- // listMap()
- return
- }
-
- switch n.WidgetType {
- case widget.Button:
- log.Log(NOW, "Should delete Button here:", n.progname)
- log.Log(NOW, "Parent:")
- pt.Dump(true)
- log.Log(NOW, "Child:")
- ct.Dump(true)
- if pt.uiBox == nil {
- log.Log(NOW, "Don't know how to destroy this")
- } else {
- log.Log(NOW, "Fuck it, destroy the whole box", n.parent.progname)
- // pt.uiBox.Destroy() // You have a bug: You cannot destroy a uiControl while it still has a parent.
- pt.uiBox.SetPadded(false)
- pt.uiBox.Delete(4)
- ct.uiButton.Disable()
- // ct.uiButton.Hide()
- ct.uiButton.Destroy()
- }
-
- case widget.Window:
- log.Log(NOW, "Should delete Window here:", n.progname)
- default:
- log.Log(NOW, "Fuckit, let's destroy a button")
- if ct.uiButton != nil {
- pt.uiBox.Delete(4)
- ct.uiButton.Destroy()
- }
- }
-}