From 4b6207743b90968d6b822032a4355e43b6ce6da9 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 3 Apr 2023 10:26:47 -0500 Subject: gocui: working towards correct layout make a gocui widget binary tree more debugging cleanups sample button app displays in gocui geometry logic closer to correct improvements in gocui layout continued attempts to clean up tabs dump binary tree moving towards proper chan callback() deprecate Widget.Name Signed-off-by: Jeff Carr --- toolkit/andlabs/common.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'toolkit/andlabs/common.go') diff --git a/toolkit/andlabs/common.go b/toolkit/andlabs/common.go index 5e1b0fb..cddea3e 100644 --- a/toolkit/andlabs/common.go +++ b/toolkit/andlabs/common.go @@ -5,13 +5,17 @@ import ( ) func (t *andlabsT) commonChange(tw *toolkit.Widget, wId int) { - log(debugChange, "commonChange() START widget =", t.tw.Name, t.tw.Type) + log(debugChange, "commonChange() START widget =", t.Name, t.WidgetType) + if (sendToChan(wId)) { + log(debugChange, "commonChange() END attempted channel worked", t.Name, t.WidgetType) + return + } if (tw == nil) { log(true, "commonChange() What the fuck. there is no widget t.tw == nil") return } if (tw.Custom == nil) { - log(debugChange, "commonChange() END Widget.Custom() = nil", t.tw.Name, t.tw.Type) + log(debugChange, "commonChange() END Widget.Custom() = nil", t.Name, t.WidgetType) return } tw.Custom() @@ -20,16 +24,15 @@ func (t *andlabsT) commonChange(tw *toolkit.Widget, wId int) { log(debugError, "commonChange() ERROR: wId map == nil", wId) return } - sendToChan(wId) - log(debugChange, "commonChange() END Widget.Custom()", t.tw.Name, t.tw.Type) + log(debugChange, "commonChange() END Widget.Custom()", t.Name, t.WidgetType) } -func sendToChan(i int) { +func sendToChan(i int) bool { if (callback == nil) { log(debugError, "commonChange() SHOULD SEND int back here, but callback == nil", i) - return + return false } log(debugError, "commonChange() Running callback() i =", i) - callback(i) + return callback(i) } -- cgit v1.2.3