summaryrefslogtreecommitdiff
path: root/lineedit.go
diff options
context:
space:
mode:
Diffstat (limited to 'lineedit.go')
-rw-r--r--lineedit.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/lineedit.go b/lineedit.go
index 2321227..2d89a5c 100644
--- a/lineedit.go
+++ b/lineedit.go
@@ -35,24 +35,22 @@ 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
}
@@ -70,15 +68,9 @@ func (l *LineEdit) make(window *sysData) error {
}
func (l *LineEdit) 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 *LineEdit) preferredSize() (width int, height int) {
- l.lock.Lock()
- defer l.lock.Unlock()
-
return l.sysData.preferredSize()
}