summaryrefslogtreecommitdiff
path: root/andlabs/delete.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-08 21:19:42 -0600
committerJeff Carr <[email protected]>2024-01-08 21:19:42 -0600
commit02d1d9e50cab6cde6d2096efdd94756b0ba37ec6 (patch)
tree806b141c91fb2bc69cdeb8efe58b2965f4f592b0 /andlabs/delete.go
parent3c2da3f096a5e8aeaa657deb2dc047cc23118c99 (diff)
moved to 'go.wit.com/log'
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'andlabs/delete.go')
-rw-r--r--andlabs/delete.go23
1 files changed, 13 insertions, 10 deletions
diff --git a/andlabs/delete.go b/andlabs/delete.go
index c6fa6d2..a2c50ae 100644
--- a/andlabs/delete.go
+++ b/andlabs/delete.go
@@ -2,19 +2,22 @@ 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/gui/widget"
+import (
+ "go.wit.com/log"
+ "go.wit.com/gui/widget"
+)
// delete the child widget from the parent
// p = parent, c = child
func (n *node) destroy() {
pId := n.parent.WidgetId
cId := n.WidgetId
- log(logNow, "delete()", pId, cId)
+ log.Log(NOW, "delete()", pId, cId)
pt := n.parent.tk
ct := n.tk
if (ct == nil) {
- log(true, "delete FAILED (ct = mapToolkit[c] == nil) for c", pId, cId)
+ log.Log(NOW, "delete FAILED (ct = mapToolkit[c] == nil) for c", pId, cId)
// this pukes out a whole universe of shit
// listMap()
return
@@ -22,15 +25,15 @@ func (n *node) destroy() {
switch n.WidgetType {
case widget.Button:
- log(true, "Should delete Button here:", n.Name)
- log(true, "Parent:")
+ log.Log(NOW, "Should delete Button here:", n.Name)
+ log.Log(NOW, "Parent:")
pt.Dump(true)
- log(true, "Child:")
+ log.Log(NOW, "Child:")
ct.Dump(true)
if (pt.uiBox == nil) {
- log(true, "Don't know how to destroy this")
+ log.Log(NOW, "Don't know how to destroy this")
} else {
- log(true, "Fuck it, destroy the whole box", n.parent.Name)
+ log.Log(NOW, "Fuck it, destroy the whole box", n.parent.Name)
// 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)
@@ -40,9 +43,9 @@ func (n *node) destroy() {
}
case widget.Window:
- log(true, "Should delete Window here:", n.Name)
+ log.Log(NOW, "Should delete Window here:", n.Name)
default:
- log(true, "Fuckit, let's destroy a button")
+ log.Log(NOW, "Fuckit, let's destroy a button")
if (ct.uiButton != nil) {
pt.uiBox.Delete(4)
ct.uiButton.Destroy()