summaryrefslogtreecommitdiff
path: root/cmds/buttonAsPlugin
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 /cmds/buttonAsPlugin
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 'cmds/buttonAsPlugin')
-rw-r--r--cmds/buttonAsPlugin/Makefile14
-rw-r--r--cmds/buttonAsPlugin/main.go33
2 files changed, 47 insertions, 0 deletions
diff --git a/cmds/buttonAsPlugin/Makefile b/cmds/buttonAsPlugin/Makefile
new file mode 100644
index 0000000..431d956
--- /dev/null
+++ b/cmds/buttonAsPlugin/Makefile
@@ -0,0 +1,14 @@
+run: build
+ ./buttonAsPlugin
+
+build-release:
+ go get -v -u -x .
+ go build
+ ./buttonAsPlugin
+
+build:
+ GO111MODULE="off" go get -v -x .
+ GO111MODULE="off" go build
+
+update:
+ GO111MODULE="off" go get -v -u -x .
diff --git a/cmds/buttonAsPlugin/main.go b/cmds/buttonAsPlugin/main.go
new file mode 100644
index 0000000..1c2eeaf
--- /dev/null
+++ b/cmds/buttonAsPlugin/main.go
@@ -0,0 +1,33 @@
+// This is a simple example
+package main
+
+import (
+ "log"
+ "git.wit.org/wit/gui"
+)
+
+func main() {
+ gui.Main(buttonWindow)
+}
+
+// This creates a window
+func buttonWindow() {
+ var w, g *gui.Node
+ gui.Config.Title = "Demo Plugin Window"
+ gui.Config.Width = 640
+ gui.Config.Height = 480
+
+// gui.Config.Exit = gui.StandardClose
+// gui.SetDebug(true)
+
+ w = gui.NewWindow()
+ g = w.NewGroup("buttonGroup")
+
+ g.NewButton("hello", func () {
+ log.Println("world")
+ })
+
+ g.NewButton("foo", func () {
+ log.Println("bar")
+ })
+}