20 lines
438 B
Go
20 lines
438 B
Go
package objects
|
|
|
|
import "git.tebibyte.media/tomo/tomo"
|
|
|
|
// Label is a simple text label.
|
|
type Label struct {
|
|
tomo.TextBox
|
|
}
|
|
|
|
// NewLabel creates a new text label.
|
|
func NewLabel (text string) *Label {
|
|
this := &Label { TextBox: tomo.NewTextBox() }
|
|
this.SetRole(tomo.R("objects", "Label"))
|
|
this.SetText(text)
|
|
this.SetAttr(tomo.AAlign(tomo.AlignStart, tomo.AlignMiddle))
|
|
this.SetSelectable(true)
|
|
this.SetFocusable(true)
|
|
return this
|
|
}
|