summaryrefslogtreecommitdiff
path: root/label.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-15 15:51:06 -0500
committerPietro Gagliardi <[email protected]>2014-02-15 15:51:06 -0500
commit558c618fbf6e8a1db88ca929531d654cb49a2b60 (patch)
tree18efd030daae421308beac264c54720eb0b98f2f /label.go
parentc20e3a261195889029d71e9490674fe48104a170 (diff)
Gave all relevant controls matching SetText()/Text() pairs. Also added a TODO for Checkbox related to checked state.
Diffstat (limited to 'label.go')
-rw-r--r--label.go23
1 files changed, 22 insertions, 1 deletions
diff --git a/label.go b/label.go
index cadeff0..6f2aba2 100644
--- a/label.go
+++ b/label.go
@@ -22,7 +22,28 @@ func NewLabel(text string) *Label {
}
}
-// TODO SetText()/Text()?
+// SetText sets the Label's text.
+func (l *Label) SetText(text string) (err error) {
+ l.lock.Lock()
+ defer l.lock.Unlock()
+
+ if l.created {
+ return l.sysData.setText(text)
+ }
+ l.initText = text
+ return nil
+}
+
+// Text returns the Label's text.
+func (l *Label) Text() string {
+ l.lock.Lock()
+ defer l.lock.Unlock()
+
+ if l.created {
+ return l.sysData.text()
+ }
+ return l.initText
+}
func (l *Label) make(window *sysData) error {
l.lock.Lock()