summaryrefslogtreecommitdiff
path: root/window.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2022-11-06 12:59:24 -0600
committerJeff Carr <[email protected]>2022-11-06 12:59:24 -0600
commite55fb6675d692e3f44fa67b02b12661e476bd028 (patch)
treec16084dea9779f5ef244adb3937d33adb17e7bad /window.go
parent099efb6b24caf9eaad50d7386636a7ac23552bde (diff)
start trying to make the tookits pluginsv0.4.3
totally minimize helloworld demo try to make a button plugin example debug changes final changes before attempting to use a golang plugin actually running gocui as a plugin add gocli-as-plugin example try to convert the go-cui toolkit into a plugin doc updates make a minimal console gui Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'window.go')
-rw-r--r--window.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/window.go b/window.go
index 538e0fe..06db292 100644
--- a/window.go
+++ b/window.go
@@ -23,19 +23,23 @@ func NewWindow() *Node {
// Windows are created off of the master node of the Binary Tree
n = Config.master.New(title)
- // n.custom = f
+
+ n.OnChanged = Config.Exit
t = toolkit.NewWindow(title, w, h)
t.Custom = func () {
- log.Println("Got to wit/gui Window Close START user defined close()")
- if (n.custom == nil) {
- log.Println("Got to wit/gui Window Close SKIP node.custom() == nil")
+ if (Config.Options.Debug) {
+ log.Println("Got to wit/gui Window Close START user defined close()")
+ }
+ if (n.OnChanged != nil) {
+ if (Config.Options.Debug) {
+ log.Println("Got to wit/gui Window Close SKIP node.custom() == nil")
+ }
+ n.OnChanged(n)
return
}
- n.custom()
- log.Println("Got to wit/gui Window Close END user defined close()")
+ StandardExit(n)
}
n.toolkit = t
-
return n
}