summaryrefslogtreecommitdiff
path: root/tab.go
blob: bade55f090f8171e7a96197d3f8e52a23456f900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package gui

import (
	"log"
)

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

	// TODO: standardize these checks somewhere
	if (n.toolkit == nil) {
		n.Dump()
		panic("NewTab() failed. toolkit == nil")
	}
	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
}