objects/pegboard.go

23 lines
715 B
Go
Raw Normal View History

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
// use a FlowVertical layout.
2024-09-12 12:07:54 -06:00
func NewPegboard (layout tomo.Layout, children ...tomo.Object) *Pegboard {
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
}