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-03-01 11:35:36 -06:00
|
|
|
newNode := n.New(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-03-29 23:03:04 -05:00
|
|
|
newBox := newNode.NewBox(text, true)
|
|
|
|
return newBox
|
2022-10-19 13:23:22 -05:00
|
|
|
}
|