summaryrefslogtreecommitdiff
path: root/cmds/buttonAsPlugin/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmds/buttonAsPlugin/main.go')
-rw-r--r--cmds/buttonAsPlugin/main.go33
1 files changed, 33 insertions, 0 deletions
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")
+ })
+}