From 2141e04328dcf4e4d6857fcc0a7cb551fc84fa07 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 16 Oct 2022 08:07:13 -0500 Subject: 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 --- cmds/helloworld/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cmds/helloworld/main.go') 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) +} + -- cgit v1.2.3