summaryrefslogtreecommitdiff
path: root/tab.go
diff options
context:
space:
mode:
Diffstat (limited to 'tab.go')
-rw-r--r--tab.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/tab.go b/tab.go
index 41013bd..c19ecb5 100644
--- a/tab.go
+++ b/tab.go
@@ -8,6 +8,18 @@ import (
// the 'tab' as a child
func (n *Node) NewTab(text string) *Node {
+ // check to make sure n is actually a window
+
+ 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")
+ if (n.parent.WidgetType == toolkit.Window) {
+ return n.parent.NewTab(text)
+ } else {
+ // 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)
var a toolkit.Action