From 2ec7fc29b0248fc030473de61d06fcba8e5673dd Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 25 Oct 2021 09:07:23 -0500 Subject: [PATCH] NODE: more rabbits Signed-off-by: Jeff Carr --- main.go | 4 +++- window-debug.go | 8 ++++++-- window.go | 12 ++++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 2da4053..70e0e65 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,7 @@ func Main(f func()) { ui.Main(f) } -// Other goroutines must use this +// Other goroutines must use this to access the GUI // // You can not acess / process the GUI thread directly from // other goroutines. This is due to the nature of how @@ -23,6 +23,7 @@ func Queue(f func()) { ui.QueueMain(f) } +/* func ExampleWindow() { log.Println("START gui.ExampleWindow()") @@ -30,3 +31,4 @@ func ExampleWindow() { node := NewWindow() node.AddDebugTab("jcarr Debug") } +*/ diff --git a/window-debug.go b/window-debug.go index a70bb1f..afe3918 100644 --- a/window-debug.go +++ b/window-debug.go @@ -35,7 +35,9 @@ func makeWindowDebug() ui.Control { cbox := ui.NewCombobox() for name, _ := range Data.WindowMap { - log.Println("range Data.WindowMap() name =", name) + if (Config.Debug) { + log.Println("range Data.WindowMap() name =", name) + } addName(cbox, name) } cbox.SetSelected(0) @@ -153,7 +155,9 @@ func makeWindowDebug() ui.Control { nodeCombo := ui.NewCombobox() for name, node := range Data.NodeMap { - log.Println("range Data.NodeMap() name =", name) + if (Config.Debug) { + log.Println("range Data.NodeMap() name =", name) + } addNodeName(nodeCombo, node.id) } nodeCombo.SetSelected(0) diff --git a/window.go b/window.go index 69a1613..fb142ac 100644 --- a/window.go +++ b/window.go @@ -52,6 +52,7 @@ func DeleteWindow(name string) { } } +/* func CreateWindow(title string, tabname string, x int, y int, custom func() ui.Control) *Node { n := CreateBlankWindow(title, x, y) if (n.box == nil) { @@ -64,7 +65,9 @@ func CreateWindow(title string, tabname string, x int, y int, custom func() ui.C // TODO: run custom() here // Oct 9 return n } +*/ +/* func (n *Node) Add(e Element) *Node { newNode := n.addNode("testingAdd") if(e == Tab) { @@ -72,12 +75,14 @@ func (n *Node) Add(e Element) *Node { } return newNode } +*/ // // Create a new node // if parent == nil, that means it is a new window and needs to be put // in the window map (aka Data.NodeMap) // +/* func (parent *Node) addNode(title string) *Node { var node Node node.Name = title @@ -92,6 +97,7 @@ func (parent *Node) addNode(title string) *Node { parent.Append(&node) return &node } +*/ func makeNode(parent *Node, title string, x int, y int) *Node { var node Node @@ -106,9 +112,9 @@ func makeNode(parent *Node, title string, x int, y int) *Node { // panic("gui.makeNode() START") if (parent == nil) { if (Data.NodeMap[title] != nil) { - log.Println("Duplicate uiNewWindow() name =", title) + log.Println("Duplicate window name =", title) // TODO: just change the 'title' to something unique - panic(fmt.Sprintf("Duplicate uiNewWindow() name = %s\n", title)) + panic(fmt.Sprintf("Duplicate window name = %s\n", title)) return nil } // panic("gui.makeNode() before NodeMap()") @@ -161,6 +167,7 @@ func (n *Node) uiNewWindow(title string, x int, y int) { return } +/* func CreateBlankWindow(title string, x int, y int) *Node { node := mapWindow(nil, nil, title, x, y) box := node.box @@ -178,6 +185,7 @@ func CreateBlankWindow(title string, x int, y int) *Node { box.Window.UiWindow = window return node } +*/ /* func (n *Node) initBlankWindow() ui.Control {