From 9d075afb1df62276dea06be4a188eaee8fc69420 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 3 Dec 2023 16:08:39 -0600 Subject: clean and rename examples fix syntax try new goreadme remove autogenerated go readme.md Signed-off-by: Jeff Carr --- examples/helloworld/main.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 examples/helloworld/main.go (limited to 'examples/helloworld/main.go') 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") + }) +} -- cgit v1.2.3