summaryrefslogtreecommitdiff
path: root/tab.go
diff options
context:
space:
mode:
Diffstat (limited to 'tab.go')
-rw-r--r--tab.go23
1 files changed, 10 insertions, 13 deletions
diff --git a/tab.go b/tab.go
index bade55f..083e42f 100644
--- a/tab.go
+++ b/tab.go
@@ -7,20 +7,17 @@ import (
// This function should make a new node with the parent and
// the 'tab' as a child
-func (n *Node) NewTab(title string) *Node {
- log.Println("gui.Node.NewTab() START name =", title)
+func (n *Node) NewTab(text string) *Node {
+ newNode := n.New(text)
- // TODO: standardize these checks somewhere
- if (n.toolkit == nil) {
- n.Dump()
- panic("NewTab() failed. toolkit == nil")
+ for _, aplug := range allPlugins {
+ log.Println("gui.NewTab() aplug =", aplug.name, "name =", newNode.Widget.Name)
+ if (aplug.NewTab == nil) {
+ log.Println("\tgui.NewTab() aplug.NewTab = nil", aplug.name)
+ continue
+ }
+ aplug.NewTab(&n.Widget, &newNode.Widget)
}
- log.Println("Make new node")
- newN := n.New(title)
- log.Println("New tab to window")
- t := n.toolkit.AddTab(title)
- newN.toolkit = t
- n.Append(newN)
- return newN
+ return newNode
}