diff options
| author | Jeff Carr <[email protected]> | 2024-01-11 19:32:40 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-11 19:32:40 -0600 |
| commit | ed951e0234d428298bd6b76b07e371ce2ab3cb60 (patch) | |
| tree | 200c77deef52245e59dc96f591e16843a8125927 /box.go | |
| parent | 5f6afb8cf8293f819711ccdf791296edfd7ce7d6 (diff) | |
var value anyv0.12.2
Signed-off-by: Jeff Carr <[email protected]>
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 |
