From d4787a1ebdd08359746516dbb72f1feaf95be5b6 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 23 Mar 2023 12:35:12 -0500 Subject: Squashed commit of the following: boxes now exist and are tracked in the binary tree create for group and grid works gocui plugin no longer works. TODO: fix in next release converted everything from plugin to Action() can remove send() tab and window are now action() flags moved to action() ready for new release pad() margion() border() all work move worked! go.wit.com attept 578th try adds an early grid widget. won't work until chan andlabs/ui grid (X,Y) works right actually can put things in places in a grid Queue() means shit doesn't look right on grids lots of fucking around. why am I wasting time on image? wow. the crazy doAppend() thing is gone implement Action Show() and Hide() Signed-off-by: Jeff Carr --- toolkit/andlabs/checkbox.go | 59 +++++---------------------------------------- 1 file changed, 6 insertions(+), 53 deletions(-) (limited to 'toolkit/andlabs/checkbox.go') diff --git a/toolkit/andlabs/checkbox.go b/toolkit/andlabs/checkbox.go index d28d3dc..2ff7ccf 100644 --- a/toolkit/andlabs/checkbox.go +++ b/toolkit/andlabs/checkbox.go @@ -11,14 +11,8 @@ func (t *andlabsT) newCheckbox(w *toolkit.Widget) *andlabsT { var newt andlabsT newt.tw = w - if t.broken() { - return nil - } - newt.uiCheckbox = ui.NewCheckbox(w.Name) - newt.uiBox = t.uiBox - // t.doAppend(&newt, *newt.uiCheckbox) - t.uiBox.Append(newt.uiCheckbox, stretchy) + newt.uiControl = newt.uiCheckbox newt.uiCheckbox.OnToggled(func(spin *ui.Checkbox) { newt.tw.B = newt.checked() @@ -30,14 +24,12 @@ func (t *andlabsT) newCheckbox(w *toolkit.Widget) *andlabsT { } func (t *andlabsT) checked() bool { - if t.broken() { - return false - } - return t.uiCheckbox.Checked() } -func newCheckbox(parentW *toolkit.Widget, w *toolkit.Widget) { +func newCheckbox(a *toolkit.Action) { + w := a.Widget + parentW := a.Where log(debugToolkit, "newCheckbox()", w.Name) t := mapToolkits[parentW] @@ -46,45 +38,6 @@ func newCheckbox(parentW *toolkit.Widget, w *toolkit.Widget) { return } newt := t.newCheckbox(w) - mapWidgetsToolkits(w, newt) -} - -func doCheckbox(p *toolkit.Widget, c *toolkit.Widget) { - if broken(c) { - return - } - if (c.Action == "New") { - newCheckbox(p, c) - return - } - ct := mapToolkits[c] - if (ct == nil) { - log(true, "Trying to do something on a widget that doesn't work or doesn't exist or something", c) - return - } - if ct.broken() { - log(true, "checkbox() ct.broken", ct) - return - } - if (ct.uiCheckbox == nil) { - log(true, "checkbox() uiCheckbox == nil", ct) - return - } - log(debugChange, "Going to attempt:", c.Action) - switch c.Action { - case "Enable": - ct.uiCheckbox.Enable() - case "Disable": - ct.uiCheckbox.Disable() - case "Show": - ct.uiCheckbox.Show() - case "Hide": - ct.uiCheckbox.Hide() - case "SetText": - ct.uiCheckbox.SetText(c.S) - case "Set": - ct.uiCheckbox.SetChecked(c.B) - default: - log(debugError, "Can't do", c.Action, "to a checkbox") - } + place(a, t, newt) + mapWidgetsToolkits(a, newt) } -- cgit v1.2.3