objects/label.go

18 lines
379 B
Go
Raw Normal View History

2023-08-08 10:46:19 -06:00
package objects
import "git.tebibyte.media/tomo/tomo"
// Label is a simple text label.
2023-08-09 09:35:24 -06:00
type Label struct {
tomo.TextBox
}
2023-08-08 10:46:19 -06:00
// NewLabel creates a new text label.
2023-08-09 09:35:24 -06:00
func NewLabel (text string) *Label {
this := &Label { TextBox: tomo.NewTextBox() }
2024-06-03 19:13:18 -06:00
this.SetRole(tomo.R("objects", "Label", ""))
2023-08-09 09:35:24 -06:00
this.SetText(text)
this.SetAlign(tomo.AlignStart, tomo.AlignMiddle)
2023-08-09 09:35:24 -06:00
return this
2023-08-08 10:46:19 -06:00
}