summaryrefslogtreecommitdiff
path: root/label.go
diff options
context:
space:
mode:
Diffstat (limited to 'label.go')
-rw-r--r--label.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/label.go b/label.go
index 76344f9..82b8731 100644
--- a/label.go
+++ b/label.go
@@ -24,24 +24,22 @@ func NewLabel(text string) *Label {
// SetText sets the Label's text.
func (l *Label) SetText(text string) {
- l.lock.Lock()
- defer l.lock.Unlock()
-
if l.created {
l.sysData.setText(text)
return
}
+ l.lock.Lock()
+ defer l.lock.Unlock()
l.initText = text
}
// 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()
}
+ l.lock.Lock()
+ defer l.lock.Unlock()
return l.initText
}
@@ -58,15 +56,9 @@ func (l *Label) make(window *sysData) error {
}
func (l *Label) setRect(x int, y int, width int, height int, winheight int) error {
- l.lock.Lock()
- defer l.lock.Unlock()
-
return l.sysData.setRect(x, y, width, height, winheight)
}
func (l *Label) preferredSize() (width int, height int) {
- l.lock.Lock()
- defer l.lock.Unlock()
-
return l.sysData.preferredSize()
}