summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-19 08:10:21 -0600
committerJeff Carr <[email protected]>2024-02-19 08:10:21 -0600
commitcddced4bc8e963c9e5a2af17c8e024a52bbc3c90 (patch)
treedd1ea79c8b7e3fd2213e6319b3ae78a06a2d0441 /main.go
parentf4605dbbd165348362ea38b6313b0818196cc675 (diff)
compiles and runs. maybe it's a plugin? maybe not
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'main.go')
-rw-r--r--main.go57
1 files changed, 57 insertions, 0 deletions
diff --git a/main.go b/main.go
new file mode 100644
index 0000000..7e11f16
--- /dev/null
+++ b/main.go
@@ -0,0 +1,57 @@
+package main
+
+/*
+ This is reference code for toolkit developers
+
+ The 'nocui' is a bare minimum toolkit. It's all you need
+ to interact with the GUI
+*/
+
+import (
+ "embed"
+
+ "go.wit.com/log"
+ "go.wit.com/toolkits/tree"
+
+ "github.com/faiface/pixel/pixelgl"
+)
+
+//go:embed *.glsl
+var glFile embed.FS
+
+func init() {
+ log.Log(INFO, "Init()")
+
+ me.myTree = tree.New()
+ me.myTree.PluginName = "nocui"
+ // me.myTree.ActionFromChannel = doAction
+
+ me.myTree.NodeAction = newaction
+ me.myTree.Add = Add
+ me.myTree.SetTitle = SetTitle
+ me.myTree.SetLabel = SetLabel
+ me.myTree.SetText = SetText
+ me.myTree.AddText = AddText
+
+ me.exit = false
+
+ log.Log(INFO, "Init() END")
+
+ showOptions()
+
+ // This parses the command line arguments
+ parseConfig()
+
+ pixelgl.Run(run)
+
+ go simpleStdin()
+}
+
+// this must be defined for plugin's, but is never run
+// I assume it's for testing the code in a stand alone way
+func main() {
+ // This parses the command line arguments
+ parseConfig()
+
+ pixelgl.Run(run)
+}