2023-04-23 14:35:32 -05:00
|
|
|
package gui
|
|
|
|
|
|
|
|
import (
|
2024-01-05 13:18:44 -06:00
|
|
|
"go.wit.com/gui/widget"
|
2023-04-23 14:35:32 -05:00
|
|
|
)
|
|
|
|
|
2024-01-13 22:02:12 -06:00
|
|
|
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
|
2024-01-11 19:32:40 -06:00
|
|
|
}
|
2024-01-13 22:02:12 -06:00
|
|
|
|
|
|
|
// inform the toolkits
|
|
|
|
sendAction(newNode, widget.Add)
|
2024-01-11 19:32:40 -06:00
|
|
|
return newNode
|
|
|
|
}
|
|
|
|
|
2024-01-13 22:02:12 -06:00
|
|
|
func (parent *Node) NewHorizontalBox(progname string) *Node {
|
|
|
|
newNode := parent.newNode(progname, widget.Box)
|
|
|
|
newNode.progname = progname
|
2024-01-11 19:32:40 -06:00
|
|
|
|
2024-01-13 22:02:12 -06:00
|
|
|
newNode.direction = widget.Horizontal
|
|
|
|
|
|
|
|
// inform the toolkits
|
|
|
|
sendAction(newNode, widget.Add)
|
2024-01-11 19:32:40 -06:00
|
|
|
return newNode
|
|
|
|
}
|
|
|
|
|
2024-01-13 22:02:12 -06:00
|
|
|
func (parent *Node) NewVerticalBox(progname string) *Node {
|
|
|
|
newNode := parent.newNode(progname, widget.Box)
|
|
|
|
newNode.progname = progname
|
2024-01-11 19:32:40 -06:00
|
|
|
|
2024-01-13 22:02:12 -06:00
|
|
|
newNode.direction = widget.Vertical
|
|
|
|
|
|
|
|
// inform the toolkits
|
|
|
|
sendAction(newNode, widget.Add)
|
2023-04-23 14:35:32 -05:00
|
|
|
return newNode
|
|
|
|
}
|