new-gui/box.go

43 lines
874 B
Go
Raw Normal View History

package gui
import (
"go.wit.com/gui/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) 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
}