diff options
Diffstat (limited to 'cmds/buttonAsPlugin')
| -rw-r--r-- | cmds/buttonAsPlugin/Makefile | 14 | ||||
| -rw-r--r-- | cmds/buttonAsPlugin/main.go | 33 |
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") + }) +} |
