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 --- int.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 int.go (limited to 'int.go') diff --git a/int.go b/int.go new file mode 100644 index 0000000..9543344 --- /dev/null +++ b/int.go @@ -0,0 +1,28 @@ +package gui + +import "log" + +import "github.com/davecgh/go-spew/spew" + +// import toolkit "git.wit.org/wit/gui/toolkit/andlabs" + + +// Get the int from the gui toolkit +// TODO: instead store the int in the Node structure? (this is probably a better idea) +// because eventually this gui package should become it's own seperate go routine and never interact from the +// gui subroutine back into the upstream application using the gui package +func (n *Node) Int() int { + if (Config.DebugToolkit) { + log.Println("gui.Node.Int() for node name =", n.Name) + scs := spew.ConfigState{MaxDepth: 1} + scs.Dump(n) + } + + if (n.Toolkit == nil) { + log.Println("gui.Node.Int() for toolkit struct = nil") + return 0 + } + + i := n.Toolkit.Value() + return i +} -- cgit v1.2.3