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/window.go | 50 ++++++----------------------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) (limited to 'toolkit/andlabs/window.go') diff --git a/toolkit/andlabs/window.go b/toolkit/andlabs/window.go index 8251e30..9181d5f 100644 --- a/toolkit/andlabs/window.go +++ b/toolkit/andlabs/window.go @@ -15,7 +15,8 @@ func (t *andlabsT) ErrorWindow(msg1 string, msg2 string) { ui.MsgBoxError(t.uiWindow, msg1, msg2) } -func newWindow(w *toolkit.Widget) { +func newWindow(a *toolkit.Action) { + w := a.Widget var newt *andlabsT log(debugToolkit, "toolkit NewWindow", w.Name, w.Width, w.Height) @@ -37,10 +38,11 @@ func newWindow(w *toolkit.Widget) { }) win.Show() newt.uiWindow = win + newt.uiControl = win // newt.UiWindowBad = win // deprecate this as soon as possible newt.Name = w.Name - mapWidgetsToolkits(w, newt) + mapWidgetsToolkits(a, newt) return } @@ -54,46 +56,6 @@ func (t *andlabsT) SetWindowTitle(title string) { } } -func doWindow(c *toolkit.Widget) { - if broken(c) { - return - } - if (c.Action == "New") { - newWindow(c) - return - } - ct := mapToolkits[c] - if (ct == nil) { - log(debugError, "Trying to do something on a widget that doesn't work or doesn't exist or something", c) - return - } - if (ct.uiWindow == nil) { - log(debugError, "Window() uiWindow == nil", ct) - return - } - log(debugChange, "Going to attempt:", c.Action) - switch c.Action { - case "Show": - ct.uiWindow.Show() - case "Hide": - ct.uiWindow.Hide() - case "Enable": - ct.uiWindow.Enable() - case "Disable": - ct.uiWindow.Disable() - case "Get": - c.S = ct.uiWindow.Title() - case "Set": - ct.uiWindow.SetTitle(c.S) - case "SetText": - ct.uiWindow.SetTitle(c.S) - case "SetMargin": - ct.uiWindow.SetMargined(c.B) - case "SetBorder": - ct.uiWindow.SetBorderless(c.B) - case "Delete": - ct.uiWindow.Destroy() - default: - log(debugError, "Can't do", c.Action, "to a Window") - } +func doWindow(a *toolkit.Action) { + newWindow(a) } -- cgit v1.2.3