2023-08-10 15:52:01 -06:00
|
|
|
package objects
|
|
|
|
|
|
|
|
import "git.tebibyte.media/tomo/tomo"
|
|
|
|
|
2024-08-24 13:04:44 -06:00
|
|
|
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...)
|
2024-08-24 13:02:17 -06:00
|
|
|
this.box.SetRole(tomo.R("objects", "Container"))
|
|
|
|
this.box.SetTag("outer", true)
|
2023-08-10 15:52:01 -06:00
|
|
|
return this
|
|
|
|
}
|