-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlabel.go
35 lines (28 loc) · 876 Bytes
/
label.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package goey
import (
"bitbucket.org/rj/goey/base"
)
var (
labelKind = base.NewKind("bitbucket.org/rj/goey.Label")
)
// Label describes a widget that provides a descriptive label for other fields.
type Label struct {
Text string // Text is the contents of the label
}
// Kind returns the concrete type for use in the Widget interface.
// Users should not need to use this method directly.
func (*Label) Kind() *base.Kind {
return &labelKind
}
// Mount creates a label control in the GUI.
// The newly created widget will be a child of the widget specified by parent.
func (w *Label) Mount(parent base.Control) (base.Element, error) {
// Forward to the platform-dependant code
return w.mount(parent)
}
func (*labelElement) Kind() *base.Kind {
return &labelKind
}
func (w *labelElement) UpdateProps(data base.Widget) error {
return w.updateProps(data.(*Label))
}