From 22e0033c695797f5ed4093aa41dd4f7f87478bb6 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 24 Apr 2023 08:45:30 -0500 Subject: [PATCH] try to find the parent window Signed-off-by: Jeff Carr --- tab.go | 9 +++++++-- toolkit/gocui/showStdout.go | 5 ----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tab.go b/tab.go index c19ecb5..5cdc0ad 100644 --- a/tab.go +++ b/tab.go @@ -12,13 +12,18 @@ func (n *Node) NewTab(text string) *Node { if (n.WidgetType != toolkit.Window) { // figure out what the actual window is - log(logError, "NewTab() is being requested on something that isn't a Window") + log(logError, "NewTab() is being requested on something that isn't a Window. node =", n) + log(logError, "NewTab() parent", n.parent) + return n.parent.NewTab(text) + /* if (n.parent.WidgetType == toolkit.Window) { - return n.parent.NewTab(text) } else { + if (n.parent.WidgetType == toolkit.Window) { + return n.parent.NewTab(text) // TODO: find a window. any window. never give up. never die. panic("NewTab did not get passed a window") } + */ } newNode := n.newNode(text, toolkit.Tab, nil) diff --git a/toolkit/gocui/showStdout.go b/toolkit/gocui/showStdout.go index c367ab9..d6469f7 100644 --- a/toolkit/gocui/showStdout.go +++ b/toolkit/gocui/showStdout.go @@ -1,7 +1,3 @@ -// Copyright 2014 The gocui Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - package main import ( @@ -34,7 +30,6 @@ func showMsg(g *gocui.Gui, v *gocui.View) error { if l, err = v.Line(cy); err != nil { l = "" } - // setOutput(me.rootNode) makeOutputWidget(g, l) return nil