diff options
Diffstat (limited to 'box.go')
| -rw-r--r-- | box.go | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -6,10 +6,36 @@ import ( func (parent *Node) NewBox(name string, b bool) *Node { newNode := parent.newNode(name, widget.Box) - newNode.B = b if ! newNode.hidden { a := newAction(newNode, widget.Add) + if b { + a.Direction = widget.Horizontal + } else { + a.Direction = widget.Vertical + } + sendAction(a) + } + return newNode +} + +func (parent *Node) NewHorizontalBox(name string) *Node { + newNode := parent.newNode(name, widget.Box) + + if ! newNode.hidden { + a := newAction(newNode, widget.Add) + a.Direction = widget.Horizontal + sendAction(a) + } + return newNode +} + +func (parent *Node) NewVerticalBox(name string) *Node { + newNode := parent.newNode(name, widget.Box) + + if ! newNode.hidden { + a := newAction(newNode, widget.Add) + a.Direction = widget.Vertical sendAction(a) } return newNode |
