summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/window.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-03-01 11:35:36 -0600
committerJeff Carr <[email protected]>2023-03-01 11:35:36 -0600
commit8dbf5a09097b7868e9218bf98716c57eac998a10 (patch)
treeab3bdfeaf5a59a55de9d2a6661d2d824090491e5 /toolkit/andlabs/window.go
parentf3bb68396afa7452ecf1c8d4744c825a9d81057c (diff)
lots cleaner code between the pluginv0.6.1
Queue() around SetText is helping userspace crashing merge forceDump(bool) into Dump() debugging output configuration is pretty clean keep cutting down duplicate things --gui-verbose flag works make label "standard" code add debug.FreeOSMemory() move the GO language internals to display in the GUI update push to do tags and go to github.com/wit-go/ remove the other license file it might be confusing golang.org and github proper WidgetType added a Quit() button Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/window.go')
-rw-r--r--toolkit/andlabs/window.go31
1 files changed, 10 insertions, 21 deletions
diff --git a/toolkit/andlabs/window.go b/toolkit/andlabs/window.go
index 7527ac5..40cd410 100644
--- a/toolkit/andlabs/window.go
+++ b/toolkit/andlabs/window.go
@@ -15,8 +15,8 @@ func (t *andlabsT) ErrorWindow(msg1 string, msg2 string) {
ui.MsgBoxError(t.uiWindow, msg1, msg2)
}
-func NewWindow(w *toolkit.Widget) {
- var t *andlabsT
+func newWindow(w *toolkit.Widget) {
+ var newt *andlabsT
log(debugToolkit, "toolkit NewWindow", w.Name, w.Width, w.Height)
@@ -24,34 +24,23 @@ func NewWindow(w *toolkit.Widget) {
log(debugToolkit, "wit/gui plugin error. widget == nil")
return
}
- t = new(andlabsT)
- // t = NewWindow2(w.Name, w.Width, w.Height)
+ newt = new(andlabsT)
+ newt.tw = w
-// func NewWindow2(title string, x int, y int) *andlabsT {
// menubar bool is if the OS defined border on the window should be used
win := ui.NewWindow(w.Name, w.Width, w.Height, menubar)
win.SetBorderless(canvas)
win.SetMargined(margin)
win.OnClosing(func(*ui.Window) bool {
- log(debugToolkit, "ui.Window().OnExit() SHOULD ATTEMPT CALLBACK here")
- t.Dump()
- if (w.Custom != nil) {
- w.Custom()
- return true
- }
- // if (w.Event != nil) {
- // w.Event(w)
- // return true
- // }
- log(debugToolkit, "andlabs.ui.Window().OnClosing() was not defined")
- return false
+ newt.commonChange(newt.tw)
+ return true
})
win.Show()
- t.uiWindow = win
- t.UiWindowBad = win // deprecate this as soon as possible
- t.Name = w.Name
+ newt.uiWindow = win
+ // newt.UiWindowBad = win // deprecate this as soon as possible
+ newt.Name = w.Name
- mapWidgetsToolkits(w, t)
+ mapWidgetsToolkits(w, newt)
return
}