From 0bdc53d0fa447001e04886837a5bfa54fab99a5c Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 7 Jan 2024 05:13:01 -0600 Subject: [PATCH] initial commit Signed-off-by: Jeff Carr --- .gitignore | 3 +++ main.go | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .gitignore create mode 100644 main.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..52688da --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore +!*.go diff --git a/main.go b/main.go new file mode 100644 index 0000000..9e186b4 --- /dev/null +++ b/main.go @@ -0,0 +1,43 @@ +// This is a simple example +package main + +import ( + "log" + "go.wit.com/gui/gui" + "go.wit.com/gui/gadgets" + "go.wit.com/control-panels/dns/smartwindow" +) + +var myGui *gui.Node + +func main() { + myGui = gui.New().Default() + + helloworld() + // hellosmart() + + // This is just a optional goroutine to watch that things are alive + gui.Watchdog() +} + +// This creates a window +func helloworld() { + win := gadgets.NewBasicWindow(myGui, "helloworld golang wit/gui window") + + win.Box().NewButton("hello", func () { + log.Println("world") + }) +} + +// This creates a window +func hellosmart() { + myGui = gui.New().Default() + win := smartwindow.New() + win.Title("helloworld golang wit/gui window") + win.Vertical() + win.Draw() + + win.Box().NewButton("hello", func () { + log.Println("world") + }) +}