objects/container.go

22 lines
602 B
Go
Raw Normal View History

2023-08-10 15:52:01 -06:00
package objects
import "git.tebibyte.media/tomo/tomo"
var _ tomo.ContentObject = new(Container)
2024-09-12 12:07:54 -06:00
// Container is an object that can contain other objects. It is plain looking,
// and is intended to be used within other containers as a primitive for
// building more complex layouts.
2023-08-10 15:52:01 -06:00
type Container struct {
2024-09-12 12:07:54 -06:00
abstractContainer
2023-08-10 15:52:01 -06:00
}
2024-09-12 12:07:54 -06:00
// NewContainer creates a new container.
func NewContainer (layout tomo.Layout, children ...tomo.Object) *Container {
this := &Container { }
this.init(layout, children...)
this.box.SetRole(tomo.R("objects", "Container"))
this.box.SetTag("outer", true)
2023-08-10 15:52:01 -06:00
return this
}