From 355e5ec968427c2b07b78fec12224f31a65df740 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 14 Nov 2022 14:30:28 -0600 Subject: setup building without plugins on windows notes from github remote keep removing os.Exit() rename from andlabs2 back to andlabs rename files for windows andlabs/ui gocui always sets STDOUT a file in /tmp/ Signed-off-by: Jeff Carr --- structs.go | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) (limited to 'structs.go') diff --git a/structs.go b/structs.go index af0947f..2b37ee0 100644 --- a/structs.go +++ b/structs.go @@ -3,11 +3,9 @@ package gui import ( "log" "reflect" + "git.wit.org/wit/gui/toolkit" ) -// import toolkit "git.wit.org/wit/gui/toolkit/andlabs" -import newtoolkit "git.wit.org/wit/gui/toolkit" - // // All GUI Data Structures and functions that are external // within the toolkit/ abstraction layer @@ -31,7 +29,6 @@ func SetDebug (s bool) { // also set these Config.Debug.Dump = s Config.Debug.Node = s - // toolkit.DebugToolkit = s } func GetDebugToolkit () bool { @@ -92,7 +89,7 @@ type Node struct { Width int Height int - Widget newtoolkit.Widget + Widget toolkit.Widget // this function is run when there are mouse or keyboard events OnChanged func(*Node) @@ -101,9 +98,6 @@ type Node struct { // TODO: make children a double linked list since some toolkits require order (?) children []*Node - // hmm. how do you handle this when the toolkits are plugins? - // toolkit *toolkit.Toolkit - // things that may not really be needed (?) custom func() checked bool @@ -144,26 +138,9 @@ func (n *Node) Dump() { IndentPrintln("OnChanged = ", n.OnChanged) } IndentPrintln("text = ", reflect.ValueOf(n.text).Kind(), n.text) -// if (n.toolkit != nil) { -// IndentPrintln("toolkit = ", reflect.ValueOf(n.toolkit).Kind()) -// n.toolkit.Dump() -// } -// if (n.id == nil) { -// // Node structs should never have a nil id. -// // I probably shouldn't panic here, but this is just to check the sanity of -// // the gui package to make sure it's not exiting -// panic("gui.Node.Dump() id == nil TODO: make a unigue id here in the golang gui library") -// } IndentPrintln("NODE DUMP END") } -/* -func (n *Node) SetName(name string) { - n.toolkit.SetWindowTitle(name) - return -} -*/ - func (n *Node) Append(child *Node) { n.children = append(n.children, child) if (Config.Debug.Debug) { @@ -175,12 +152,6 @@ func (n *Node) Append(child *Node) { // time.Sleep(3 * time.Second) } -/* -func (n *Node) List() { - findByIdDFS(n, "test") -} -*/ - var listChildrenParent *Node var listChildrenDepth int = 0 var defaultPadding = " " @@ -217,8 +188,7 @@ func (n *Node) ListChildren(dump bool) { log.Println("\t\t\tlistChildrenParent =",listChildrenParent.id) } if (listChildrenParent.id != n.parent.id) { - log.Println("parent.child does not match child.parent") - panic("parent.child does not match child.parent") + log.Fatalln("parent.child does not match child.parent") } } } -- cgit v1.2.3