diff options
| author | Pietro Gagliardi <[email protected]> | 2014-03-18 11:50:56 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-03-18 11:50:56 -0400 |
| commit | 24342eb05d70af48d609a224351237eb1f3d41d2 (patch) | |
| tree | a76faba6d73910fa1f982e58a0f3696c5c702ff8 /label.go | |
| parent | b95d581e86ee57de7c163efa5eb0fb165d0a1032 (diff) | |
Restored the locks everywhere except on resizing calculations. I'll run under the assumption that uitask cannot process any requests while a resize occurs, which means preferredSize() and Stack/Grid.setRect() are inherently safe... let's hope I'm right...
Diffstat (limited to 'label.go')
| -rw-r--r-- | label.go | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -24,22 +24,24 @@ 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 } |
