diff options
| author | Jeff Carr <[email protected]> | 2024-01-05 12:46:17 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-05 12:46:17 -0600 |
| commit | 0993e7d3d06186eac45ad34fd8618565219032ed (patch) | |
| tree | a9e7bb68dd0cf205af0cf970082b8eee7f620228 /tab.go | |
| parent | 6f566c0051e9627a7560b9e38ab860ae8a0940c3 (diff) | |
Tabs are Windows
Tabs don't exist. The are simply windows within a window.
There are *lots* of problems with trying to treat everything
that way. Luckily, we don't have to care. All the problems with
handling that concept can be pushed to the toolkits/
therefore, this primitive code can be kept as clean as possible
Makefile and git cleanups
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'tab.go')
| -rw-r--r-- | tab.go | 42 |
1 files changed, 0 insertions, 42 deletions
@@ -1,42 +0,0 @@ -package gui - -import ( - "go.wit.com/log" - - "go.wit.com/gui/toolkits" -) - -// This function should make a new node with the parent and -// 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.Warn("NewTab() is being requested on something that isn't a Window. node =", n) - if (n.parent == nil) { - // TODO: find a window. any window. never give up. never die. - log.Warn("NewTab() TODO: make a window here", n) - panic("NewTab did not get passed a window") - } - log.Warn("NewTab() parent =", n.parent) - if (n.parent.WidgetType == toolkit.Root) { - // also broken - log.Warn("NewTab() TODO: make or find a window here", n) - panic("NewTab() did not get passed a window") - } - // go up the binary tree until we find a window widget to add a tab too - return n.parent.NewTab(text) - } - newNode := n.newNode(text, toolkit.Tab) - - a := newAction(newNode, toolkit.Add) - sendAction(a) - - // by default, create a box inside the tab - // TODO: allow this to be configurable - newBox := newNode.NewBox(text + " box", true) - - return newBox -} |
