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/Makefile | 14 ++++++++++++++ cmds/helloworld/helloworld | Bin 3097960 -> 0 bytes cmds/helloworld/main.go | 10 ++++++++++ 3 files changed, 24 insertions(+) create mode 100644 cmds/helloworld/Makefile delete mode 100755 cmds/helloworld/helloworld (limited to 'cmds/helloworld') diff --git a/cmds/helloworld/Makefile b/cmds/helloworld/Makefile new file mode 100644 index 0000000..f18abaf --- /dev/null +++ b/cmds/helloworld/Makefile @@ -0,0 +1,14 @@ +run: build + ./helloworld + +build: + go get -v -u -x . + go build + +build-master: + GO111MODULE="off" go get -v -x . + GO111MODULE="off" go build + ./helloworld + +update: + GO111MODULE="off" go get -v -u -x . diff --git a/cmds/helloworld/helloworld b/cmds/helloworld/helloworld deleted file mode 100755 index cc41f78..0000000 Binary files a/cmds/helloworld/helloworld and /dev/null differ 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