2022-10-17 22:39:03 -05:00
|
|
|
package gui
|
|
|
|
|
|
|
|
import "log"
|
|
|
|
|
|
|
|
import toolkit "git.wit.org/wit/gui/toolkit/andlabs"
|
|
|
|
|
2022-10-19 13:23:22 -05:00
|
|
|
// TODO: which name is better. AddGroup or NewGroup ?
|
|
|
|
// first reaction is NewGroup
|
2022-10-17 22:39:03 -05:00
|
|
|
func (n *Node) NewGroup(name string) *Node {
|
2022-10-19 13:23:22 -05:00
|
|
|
var newT *toolkit.Toolkit
|
|
|
|
var gNode *Node
|
2022-10-17 22:39:03 -05:00
|
|
|
log.Println("toolkit.NewGroup() START", name)
|
|
|
|
|
2022-10-20 06:55:42 -05:00
|
|
|
if (n.toolkit == nil) {
|
|
|
|
log.Println("toolkit.NewGroup() toolkit == nil")
|
|
|
|
panic("toolkit should never be nil")
|
2022-10-19 13:23:22 -05:00
|
|
|
}
|
|
|
|
|
2022-10-17 22:39:03 -05:00
|
|
|
// make a *Node with a *toolkit.Group
|
2022-10-21 11:40:08 -05:00
|
|
|
gNode = n.New(name)
|
2022-10-20 06:55:42 -05:00
|
|
|
newT = n.toolkit.NewGroup(name)
|
|
|
|
gNode.toolkit = newT
|
2022-10-17 22:39:03 -05:00
|
|
|
gNode.Dump()
|
|
|
|
|
2022-10-19 13:23:22 -05:00
|
|
|
return gNode
|
2022-10-17 22:39:03 -05:00
|
|
|
}
|
|
|
|
|
2022-10-21 11:40:08 -05:00
|
|
|
/*
|
2022-10-17 22:39:03 -05:00
|
|
|
func (n *Node) AddGroup(title string) *Node {
|
2022-10-20 06:55:42 -05:00
|
|
|
return n.NewGroup(title + " deprecated AddGroup")
|
2022-10-17 22:39:03 -05:00
|
|
|
}
|
2022-10-21 11:40:08 -05:00
|
|
|
*/
|