From 933a7e4df0e6a28ad06dfd60ab2928d5cdf916f9 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 6 Apr 2023 20:25:14 -0500 Subject: andlabs: callback is now safe through a go channel Signed-off-by: Jeff Carr --- toolkit/andlabs/button.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'toolkit/andlabs/button.go') diff --git a/toolkit/andlabs/button.go b/toolkit/andlabs/button.go index 94e2966..bc58da2 100644 --- a/toolkit/andlabs/button.go +++ b/toolkit/andlabs/button.go @@ -23,14 +23,15 @@ func newButton(a *toolkit.Action) { b = ui.NewButton(a.Text) newt.uiButton = b newt.uiControl = b - newt.tw = a.Widget + newt.wId = a.WidgetId + // newt.tw = a.Widget newt.WidgetType = a.WidgetType newt.parent = t + place(a, t, newt) + b.OnClicked(func(*ui.Button) { - newt.commonChange(newt.tw, a.WidgetId) + newt.doUserEvent() }) - place(a, t, newt) - // mapWidgetsToolkits(a, newt) } -- cgit v1.2.3