summaryrefslogtreecommitdiff
path: root/cmds/helloworld/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2022-10-16 08:07:13 -0500
committerJeff Carr <[email protected]>2022-10-16 08:07:13 -0500
commit2141e04328dcf4e4d6857fcc0a7cb551fc84fa07 (patch)
treef8b2a5d8cf17f9ccfcfa8c1699fe4a52ea8338e2 /cmds/helloworld/main.go
parent3c899365154e48aefbc0b5ee48cd089f49339cb2 (diff)
Add slander and spinbox in toolkit/andlabs
fix the helloworld demo move slider into toolkit/ move more into the toolkit directory add spinbox() fix example minor update fix examples Fix andlabs.ui.Slider() to work again correctly implement custom OnChange() callback Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'cmds/helloworld/main.go')
-rw-r--r--cmds/helloworld/main.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmds/helloworld/main.go b/cmds/helloworld/main.go
index 1cb1bbd..6e52a0b 100644
--- a/cmds/helloworld/main.go
+++ b/cmds/helloworld/main.go
@@ -2,6 +2,8 @@
package main
import (
+ "os"
+ "log"
"git.wit.org/wit/gui"
)
@@ -14,6 +16,8 @@ func initGUI() {
gui.Config.Title = "Hello World golang wit/gui Window"
gui.Config.Width = 640
gui.Config.Height = 480
+ gui.Config.Exit = myDefaultExit
+
node1 := gui.NewWindow()
addDemoTab(node1, "A Simple Tab Demo")
addDemoTab(node1, "A Second Tab")
@@ -25,3 +29,9 @@ func addDemoTab(n *gui.Node, title string) {
groupNode1 := newNode.AddGroup("group 1")
groupNode1.AddComboBox("demoCombo2", "more 1", "more 2", "more 3")
}
+
+func myDefaultExit(n *gui.Node) {
+ log.Println("You can Do exit() things here")
+ os.Exit(0)
+}
+