diff options
Diffstat (limited to 'cmds/gui-demo')
| -rw-r--r-- | cmds/gui-demo/Makefile | 5 | ||||
| -rw-r--r-- | cmds/gui-demo/main.go | 56 |
2 files changed, 0 insertions, 61 deletions
diff --git a/cmds/gui-demo/Makefile b/cmds/gui-demo/Makefile deleted file mode 100644 index 41fdd10..0000000 --- a/cmds/gui-demo/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -run: build - ./gui-demo - -build: - go build diff --git a/cmds/gui-demo/main.go b/cmds/gui-demo/main.go deleted file mode 100644 index 54ad449..0000000 --- a/cmds/gui-demo/main.go +++ /dev/null @@ -1,56 +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") - - go gui.Main(initGUI) - - watchGUI() -} - -// This initializes the first window -func initGUI() { - gui.DemoToolkitWindow() -} - -// 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.Queue(gui.DebugWindow) - time.Sleep(1 * time.Second) - gui.Queue(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) -} |
