diff options
| author | Jeff Carr <[email protected]> | 2023-04-27 12:41:42 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-04-27 12:41:42 -0500 |
| commit | 253dcb012f6d4fc861e6fc9a66fd2c7260ead442 (patch) | |
| tree | a3092695fa5d6769d5898e3319016f0bb84ae6e9 /toolkit/andlabs/delete.go | |
| parent | 8100e7a1abdc31afbf65af6d0b7cd7cb0fff69eb (diff) | |
andlabs: deprecate old code
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/delete.go')
| -rw-r--r-- | toolkit/andlabs/delete.go | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/toolkit/andlabs/delete.go b/toolkit/andlabs/delete.go index dc28371..f171344 100644 --- a/toolkit/andlabs/delete.go +++ b/toolkit/andlabs/delete.go @@ -6,11 +6,13 @@ import "git.wit.org/wit/gui/toolkit" // delete the child widget from the parent // p = parent, c = child -func destroy(pId int, cId int) { - log(true, "delete()", pId, cId) +func (n *node) destroy() { + pId := n.parent.WidgetId + cId := n.WidgetId + log(logNow, "delete()", pId, cId) - pt := andlabs[pId] - ct := andlabs[cId] + pt := n.parent.tk + ct := n.tk if (ct == nil) { log(true, "delete FAILED (ct = mapToolkit[c] == nil) for c", pId, cId) // this pukes out a whole universe of shit @@ -18,7 +20,7 @@ func destroy(pId int, cId int) { return } - switch ct.WidgetType { + switch n.WidgetType { case toolkit.Button: log(true, "Should delete Button here:", ct.Name) log(true, "Parent:") @@ -40,12 +42,6 @@ func destroy(pId int, cId int) { case toolkit.Window: log(true, "Should delete Window here:", ct.Name) default: - log(true, "Don't know how to delete pt =", pt.WidgetType, pt.Name, pt.uiButton) - log(true, "Don't know how to delete ct =", ct.WidgetType, ct.Name, ct.uiButton) - log(true, "Parent:") - pt.Dump(true) - log(true, "Child:") - ct.Dump(true) log(true, "Fuckit, let's destroy a button") if (ct.uiButton != nil) { pt.uiBox.Delete(4) |
