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 --- cmds/debug/Makefile | 6 ------ cmds/debug/helloworld.go | 20 ------------------ cmds/debug/main.go | 54 ------------------------------------------------ 3 files changed, 80 deletions(-) delete mode 100644 cmds/debug/Makefile delete mode 100644 cmds/debug/helloworld.go delete mode 100644 cmds/debug/main.go (limited to 'cmds/debug') diff --git a/cmds/debug/Makefile b/cmds/debug/Makefile deleted file mode 100644 index 5f979cc..0000000 --- a/cmds/debug/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -run: build - ./debug - -build: - # go build - GO111MODULE="off" go build diff --git a/cmds/debug/helloworld.go b/cmds/debug/helloworld.go deleted file mode 100644 index d0998bf..0000000 --- a/cmds/debug/helloworld.go +++ /dev/null @@ -1,20 +0,0 @@ -// A simple helloworld window -package main - -import ( - "log" - "git.wit.org/wit/gui" -) - -// This creates a window -func helloworld() { - var w *gui.Node - gui.Config.Title = "helloworld golang wit/gui window" - gui.Config.Width = 400 - gui.Config.Height = 100 - - w = gui.NewWindow() - w.NewButton("hello", func () { - log.Println("world") - }) -} diff --git a/cmds/debug/main.go b/cmds/debug/main.go deleted file mode 100644 index 375ccae..0000000 --- a/cmds/debug/main.go +++ /dev/null @@ -1,54 +0,0 @@ -package main - -import ( - "log" - "os" - "time" - - "git.wit.org/wit/gui" -) - -// This initializes the first window -// -// BUG: THIS PROGRAM DOESN'T EXIT PROPERLY (NOT REALLY A BUG) -// -// Then starts a goroutine to demonstrate how to -// inject things into the GUI -func main() { - log.Println("Starting my Control Panel") - -// gui.Init() -// go gui.Main(helloworld) - go gui.Main(gui.DebugWindow) -// go gui.DemoToolkitWindow() - - watchGUI() -} - -// This demonstrates how to properly interact with the GUI -// You can not involke the GUI from external goroutines in most cases. -func watchGUI() { - var i = 1 - for { - log.Println("Waiting", i, "seconds") - i += 1 - time.Sleep(1 * time.Second) - if i == 2 { - log.Println("Opening a Debug Window via the gui.Queue()") - gui.Config.Width = 800 - gui.Config.Height = 300 - gui.Config.Exit = myExit - // gui.DebugWindow() - time.Sleep(1 * time.Second) - // gui.DebugTab() - } - } -} - -// TODO: myExit isn't getting used anymore -func myExit(n *gui.Node) { - log.Println() - log.Println("Entered myExit() on node.Name =", n.Name) - log.Println() - os.Exit(0) -} -- cgit v1.2.3