summaryrefslogtreecommitdiff
path: root/cmds/gui-demo/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2022-10-19 13:23:22 -0500
committerJeff Carr <[email protected]>2022-10-19 13:23:22 -0500
commitf3af1f5b7ff78b3f73d7510622fc9633dec36d35 (patch)
treee4868584d5e19942938aaa122b2e1cab377db000 /cmds/gui-demo/main.go
parentf7b1036e544238d65b0e3ad46d08075aa4177032 (diff)
Refactor to 'gui/toolkit/'
* add a example cmds/consolemouse uses a console button to launch the andlabs/ui * fix wrong return value in toolkit/NewLabel() * redirect STDIN output to a file * wonderful fix of Window() exit * finally remove the ancient stupid variables x & y * phase out struct 'box' and use 'node' instead * better names for things: use NewFoo() and NewBar()
Diffstat (limited to 'cmds/gui-demo/main.go')
-rw-r--r--cmds/gui-demo/main.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/cmds/gui-demo/main.go b/cmds/gui-demo/main.go
index 0084e3a..d89b1b0 100644
--- a/cmds/gui-demo/main.go
+++ b/cmds/gui-demo/main.go
@@ -22,7 +22,7 @@ func main() {
// This initializes the first window
func initGUI() {
- gui.ToolkitDemoWindow()
+ gui.DemoToolkitWindow()
}
// This demonstrates how to properly interact with the GUI
@@ -33,24 +33,22 @@ func watchGUI() {
log.Println("Waiting", i, "seconds")
i += 1
time.Sleep(1 * time.Second)
- if i == 4 {
+ if i == 2 {
log.Println("Opening a Debug Window via the gui.Queue()")
gui.Config.Width = 800
gui.Config.Height = 300
- gui.Config.Exit = myDebugExit
+ 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)
}
-
-func myDebugExit(n *gui.Node) {
- log.Println("Entered myDebugExit() on node.Name =", n.Name)
- log.Println("Don't actually os.Exit()")
-}