From cbb777cb3dabee7fd7a9979bf4690a4ebf593666 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 25 Oct 2021 05:25:10 -0500 Subject: EXAMPLE: correctly add a tab to the example app Signed-off-by: Jeff Carr --- window-debug.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'window-debug.go') diff --git a/window-debug.go b/window-debug.go index ef457aa..3afe8e3 100644 --- a/window-debug.go +++ b/window-debug.go @@ -356,15 +356,11 @@ func addButton(box *ui.Box, name string) *ui.Button { return button } -func (n *Node) AddDemoTab(title string) { - newNode := n.AddTab(title, makeWindowTemplate()) - newNode.Dump() - tabSetMargined(newNode.uiTab) -} - func (n *Node) AddDebugTab(title string) { newNode := n.AddTab(title, makeWindowDebug()) - newNode.Dump() + if (Config.DebugNode) { + newNode.Dump() + } tabSetMargined(newNode.uiTab) } @@ -372,10 +368,14 @@ func (n *Node) AddDebugTab(title string) { // // TODO: do proper tab tracking (will be complicated). low priority func tabSetMargined(tab *ui.Tab) { - log.Println("tabSetMargined() IGNORE THIS") + if (Config.DebugTabs) { + log.Println("tabSetMargined() IGNORE THIS") + } c := tab.NumPages() for i := 0; i < c; i++ { - log.Println("tabSetMargined() i =", i) + if (Config.DebugTabs) { + log.Println("tabSetMargined() i =", i) + } tab.SetMargined(i, true) } } -- cgit v1.2.3