This commit is contained in:
2023-08-09 11:35:24 -04:00
parent de704929c8
commit 8d7d9882ba
3 changed files with 110 additions and 10 deletions

View File

@@ -4,13 +4,15 @@ import "git.tebibyte.media/tomo/tomo"
import "git.tebibyte.media/tomo/tomo/theme"
// Label is a simple text label.
type Label tomo.TextBox
// NewLabel creates a new text label.
func NewLabel (text string) Label {
box := tomo.NewTextBox()
theme.Apply(box, theme.R("objects", "Label"))
box.SetText(text)
return box
type Label struct {
tomo.TextBox
}
// NewLabel creates a new text label.
func NewLabel (text string) *Label {
this := &Label { TextBox: tomo.NewTextBox() }
theme.Apply(this, theme.R("objects", "Label"))
this.SetText(text)
return this
}