2022-10-17 00:38:27 -05:00
|
|
|
package gui
|
|
|
|
|
|
|
|
import (
|
2023-03-01 11:35:36 -06:00
|
|
|
"git.wit.org/wit/gui/toolkit"
|
2022-10-17 00:38:27 -05:00
|
|
|
)
|
|
|
|
|
2022-10-19 13:23:22 -05:00
|
|
|
// This function should make a new node with the parent and
|
|
|
|
// the 'tab' as a child
|
|
|
|
|
2022-11-13 08:53:03 -06:00
|
|
|
func (n *Node) NewTab(text string) *Node {
|
2023-04-08 11:06:50 -05:00
|
|
|
newNode := n.newNode(text, toolkit.Tab, nil)
|
2022-10-19 13:23:22 -05:00
|
|
|
|
2023-03-23 12:35:12 -05:00
|
|
|
var a toolkit.Action
|
2023-03-29 23:03:04 -05:00
|
|
|
a.ActionType = toolkit.Add
|
|
|
|
a.Name = text
|
|
|
|
a.Text = text
|
2023-03-23 12:35:12 -05:00
|
|
|
newaction(&a, newNode, n)
|
|
|
|
|
2023-04-06 14:16:59 -05:00
|
|
|
newBox := newNode.NewBox(text, true)
|
2023-03-29 23:03:04 -05:00
|
|
|
return newBox
|
2022-10-19 13:23:22 -05:00
|
|
|
}
|