2024-09-12 12:07:54 -06:00
|
|
|
package objects
|
|
|
|
|
|
|
|
import "git.tebibyte.media/tomo/tomo"
|
|
|
|
import "git.tebibyte.media/tomo/objects/layouts"
|
|
|
|
|
|
|
|
var _ tomo.ContentObject = new(Pegboard)
|
|
|
|
|
|
|
|
// Pegboard is an object that can contain other objects. It is intended to
|
|
|
|
// contain a flowed list of objects which represent some data, such as files.
|
|
|
|
type Pegboard struct {
|
|
|
|
abstractContainer
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewPegboard creates a new pegboard. If the provided layout is nil, it will
|
2024-09-12 16:11:08 -06:00
|
|
|
// use a FlowVertical layout.
|
2024-09-12 12:07:54 -06:00
|
|
|
func NewPegboard (layout tomo.Layout, children ...tomo.Object) *Pegboard {
|
2024-09-12 16:11:08 -06:00
|
|
|
if layout == nil { layout = layouts.FlowVertical }
|
2024-09-12 12:07:54 -06:00
|
|
|
pegboard := &Pegboard { }
|
|
|
|
pegboard.init(layout, children...)
|
|
|
|
pegboard.box.SetRole(tomo.R("objects", "Pegboard"))
|
|
|
|
return pegboard
|
|
|
|
}
|