try to find the parent window

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2023-04-24 08:45:30 -05:00
parent e71d4f10ca
commit 22e0033c69
2 changed files with 7 additions and 7 deletions

9
tab.go
View File

@ -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)

View File

@ -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