summaryrefslogtreecommitdiff
path: root/main.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 /main.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 'main.go')
-rw-r--r--main.go40
1 files changed, 28 insertions, 12 deletions
diff --git a/main.go b/main.go
index e87f6c2..30eb6a7 100644
--- a/main.go
+++ b/main.go
@@ -2,33 +2,33 @@ package gui
import (
"log"
+ "os"
)
import toolkit "git.wit.org/wit/gui/toolkit/andlabs"
-
-// the _ means we only need this for the init()
-
-const Xaxis = 0 // box that is horizontal
-const Yaxis = 1 // box that is vertical
+const Xaxis = 0 // stack things horizontally
+const Yaxis = 1 // stack things vertically
func init() {
log.Println("gui.init() has been run")
Config.counter = 0
Config.prefix = "wit"
- Config.Options.DebugNode = false
- Config.Options.DebugTabs = false
- title := "master"
+ // Config.Options.Debug = true
+ // Config.Options.DebugNode = true
+ // Config.Options.DebugTabs = true
+
+ title := "guiBinaryTree"
w := 640
h := 480
- // f := StandardClose
+ // Populates the top of the binary tree
Config.master = addNode(title, w, h)
- // Config.master.custom = f
-
- Config.master.Dump()
+ if (Config.Options.Debug) {
+ Config.master.Dump()
+ }
}
func Main(f func()) {
@@ -46,3 +46,19 @@ func Queue(f func()) {
log.Println("Sending function to gui.Main() (using gtk via andlabs/ui)")
toolkit.Queue(f)
}
+
+// The window is destroyed but the application does not quit
+func StandardClose(n *Node) {
+ if (Config.Options.Debug) {
+ log.Println("wit/gui Standard Window Close. name =", n.Name)
+ }
+}
+
+
+// The window is destroyed but the application does not quit
+func StandardExit(n *Node) {
+ if (Config.Options.Debug) {
+ log.Println("wit/gui Standard Window Exit. running os.Exit()")
+ }
+ os.Exit(0)
+}