diff options
| author | Jeff Carr <[email protected]> | 2023-03-01 11:35:36 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-03-01 11:35:36 -0600 |
| commit | 8dbf5a09097b7868e9218bf98716c57eac998a10 (patch) | |
| tree | ab3bdfeaf5a59a55de9d2a6661d2d824090491e5 /window.go | |
| parent | f3bb68396afa7452ecf1c8d4744c825a9d81057c (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 'window.go')
| -rw-r--r-- | window.go | 45 |
1 files changed, 20 insertions, 25 deletions
@@ -1,6 +1,7 @@ package gui import ( + "git.wit.org/wit/gui/toolkit" ) //import toolkit "git.wit.org/wit/gui/toolkit/andlabs" @@ -13,39 +14,33 @@ import ( // my guess). func NewWindow() *Node { var newNode *Node + var custom func() - title := Config.Title - // Windows are created off of the master node of the Binary Tree - newNode = Config.master.New(title, "Window") - - newNode.Widget.Width = Config.Width - newNode.Widget.Height = Config.Height - + // If the user didn't set a custom Exit() use the standard exit() function + // This makes sure the GUI properly closes everything (GTK, QT, console ui, etc exit) if (Config.Exit != nil) { - log("setting a custom exit") - newNode.custom = func() { + log(debugGui, "setting a custom exit") + custom = func() { + log(debugChange, "Running a custom exit()", Config.Exit) + log(debugChange, "Running a custom exit() Config.Title =", Config.Title) + log(debugChange, "Running a custom exit() Config.Width =", Config.Width) Config.Exit(newNode) } } else { - log("not setting a custom exit") - } - - if (newNode.custom == nil) { - newNode.custom = func () {StandardExit(newNode)} + log(debugGui, "setting the standard exit") + custom = func () { + log(debugChange, "Running StandardExit()") + StandardExit() + } } + // Windows are created off of the master node of the Binary Tree + newNode = Config.master.New(Config.Title, toolkit.Window, custom) - newNode.Widget.Custom = newNode.custom - - log(debugGui, "gui.Node.Window()", title) + newNode.widget.Width = Config.Width + newNode.widget.Height = Config.Height - for _, aplug := range allPlugins { - log(debugGui, "gui.Node.NewWindow() toolkit plugin =", aplug.name) - if (aplug.NewWindow == nil) { - log(debugGui, "gui.Node.NewWindow() is nil") - continue - } - aplug.NewWindow(&newNode.Widget) - } + log(debugGui, "Window()", Config.Title) + send(nil, newNode) return newNode } |
