summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/window.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-03-23 12:35:12 -0500
committerJeff Carr <[email protected]>2023-03-23 12:35:12 -0500
commitd4787a1ebdd08359746516dbb72f1feaf95be5b6 (patch)
treecb81756d61096ccf74af7c8cc9a15e4e00fe1da7 /toolkit/andlabs/window.go
parent6a848bf40474365cc1c0b4da9e2f7e3e10b4d627 (diff)
Squashed commit of the following:v0.7.3
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 <[email protected]>
Diffstat (limited to 'toolkit/andlabs/window.go')
-rw-r--r--toolkit/andlabs/window.go50
1 files changed, 6 insertions, 44 deletions
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)
}