package gui import ( "go.wit.com/widget" ) func (parent *Node) NewBox(progname string, b bool) *Node { newNode := parent.newNode(progname, widget.Box) newNode.progname = progname if b { newNode.direction = widget.Horizontal } else { newNode.direction = widget.Vertical } // inform the toolkits sendAction(newNode, widget.Add) return newNode } func (parent *Node) Box() *Node { newNode := parent.newNode("BOX", widget.Box) // inform the toolkits sendAction(newNode, widget.Add) return newNode } // this is an experiment. I like to think of this package like 'Sierpinski' // It's like it's in a fractional dimension because it doesn't exist // the toolkits are the things that make it visible to us. Here, we can // think abstractly about how the data is formed // make something that can't be seen at all func RawBox() *Node { newNode := me.rootNode.newNode("BOX", widget.Box) return newNode } func (n *Node) Vertical() *Node { n.direction = widget.Horizontal return n } func (n *Node) Horizontal() *Node { n.direction = widget.Horizontal return n } func (parent *Node) NewHorizontalBox(progname string) *Node { newNode := parent.newNode(progname, widget.Box) newNode.progname = progname newNode.direction = widget.Horizontal // inform the toolkits sendAction(newNode, widget.Add) return newNode } func (parent *Node) NewVerticalBox(progname string) *Node { newNode := parent.newNode(progname, widget.Box) newNode.progname = progname newNode.direction = widget.Vertical // inform the toolkits sendAction(newNode, widget.Add) return newNode }