From 176cae3a8028f2c53a91b758e238b1dfe390d71a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 27 Oct 2021 11:18:22 -0500 Subject: [PATCH] REFACTOR: still trying to clean this up Signed-off-by: Jeff Carr --- gui-example/main.go | 2 +- window-debug.go | 11 +++++++++++ window-demo-andlabs-ui.go | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gui-example/main.go b/gui-example/main.go index e1caa6e..2b8cc39 100644 --- a/gui-example/main.go +++ b/gui-example/main.go @@ -29,7 +29,7 @@ func initGUI() { node := gui.NewWindow() node.AddDemoTab("A Simple Tab Demo") - node.AddAndlabsUiDemoTab("A Simple andlabs/ui Tab Demo") + node.AddDemoAndlabsUiTab("A Simple andlabs/ui Tab Demo") } // This demonstrates how to properly interact with the GUI diff --git a/window-debug.go b/window-debug.go index e87d0dc..61a7158 100644 --- a/window-debug.go +++ b/window-debug.go @@ -249,6 +249,17 @@ func makeWindowDebug() *ui.Box { } }) + n1 = addButton(vbox, "Node.DemoAndlabsUiTab") + n1.OnClicked(func(*ui.Button) { + y := nodeCombo.Selected() + log.Println("y =", y) + log.Println("nodeNames[y] =", nodeNames[y]) + node := Data.findId(nodeNames[y]) + if (node != nil) { + node.AddDemoAndlabsUiTab("ran gui.AddDemoAndlabsUiTab() " + strconv.Itoa(Config.counter)) + } + }) + /* ///////////////////////////////////////////////////// vbox = addGroup(hbox, "Numbers") diff --git a/window-demo-andlabs-ui.go b/window-demo-andlabs-ui.go index 2c1f6cb..806dc14 100644 --- a/window-demo-andlabs-ui.go +++ b/window-demo-andlabs-ui.go @@ -8,7 +8,7 @@ import _ "github.com/andlabs/ui/winmanifest" // calls to andlabs/ui. This can be used to bypass // the obvuscation added in this package if it is desired // or needed. -func (n *Node) AddAndlabsUiDemoTab(title string) { +func (n *Node) AddDemoAndlabsUiTab(title string) { newNode := n.AddTab(title, makeAndlabsUiTab()) if (Config.DebugNode) { newNode.Dump()