diff options
Diffstat (limited to 'lineedit.go')
| -rw-r--r-- | lineedit.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lineedit.go b/lineedit.go index 4ad6889..43ec60c 100644 --- a/lineedit.go +++ b/lineedit.go @@ -35,22 +35,24 @@ func NewPasswordEdit() *LineEdit { // SetText sets the LineEdit's text. func (l *LineEdit) 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 LineEdit's text. func (l *LineEdit) 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 } |
