summaryrefslogtreecommitdiff
path: root/examples/helloworld
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-12-03 16:08:39 -0600
committerJeff Carr <[email protected]>2023-12-03 16:59:57 -0600
commit9d075afb1df62276dea06be4a188eaee8fc69420 (patch)
tree915472449c509dc7fd77f18fa43edecc46e56f46 /examples/helloworld
parent7880d9df6de1040258bea966f040e12be6205af1 (diff)
clean and rename examples
fix syntax try new goreadme remove autogenerated go readme.md Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'examples/helloworld')
-rw-r--r--examples/helloworld/Makefile14
-rw-r--r--examples/helloworld/main.go23
2 files changed, 37 insertions, 0 deletions
diff --git a/examples/helloworld/Makefile b/examples/helloworld/Makefile
new file mode 100644
index 0000000..961ed8c
--- /dev/null
+++ b/examples/helloworld/Makefile
@@ -0,0 +1,14 @@
+run: build
+ ./helloworld
+
+build-release:
+ go get -v -u -x .
+ go build
+ ./helloworld
+
+build:
+ GO111MODULE="off" go get -v -x .
+ GO111MODULE="off" go build
+
+update:
+ GO111MODULE="off" go get -v -u -x .
diff --git a/examples/helloworld/main.go b/examples/helloworld/main.go
new file mode 100644
index 0000000..3d8ba40
--- /dev/null
+++ b/examples/helloworld/main.go
@@ -0,0 +1,23 @@
+// This is a simple example
+package main
+
+import (
+ "log"
+ "git.wit.org/wit/gui"
+)
+
+func main() {
+ helloworld()
+ // This is just a optional goroutine to watch that things are alive
+ gui.Watchdog()
+}
+
+// This creates a window
+func helloworld() {
+ myGui := gui.New().Default()
+ myWindow := myGui.NewWindow("helloworld golang wit/gui window")
+
+ myWindow.NewButton("hello", func () {
+ log.Println("world")
+ })
+}