diff options
| author | Pietro Gagliardi <[email protected]> | 2014-03-17 14:09:09 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-03-17 14:09:09 -0400 |
| commit | 0e8680c04f3b364352a57e686bc93d018c6140e3 (patch) | |
| tree | fbbab88400e8a6060cb59180aa63f2d958b2af52 /lineedit.go | |
| parent | bdb26046b6e91b1cf1a3d752fc36edd059ee5a58 (diff) | |
Dumped the mutex locks from the other controls and elaborated/asked for help in the README.
Diffstat (limited to 'lineedit.go')
| -rw-r--r-- | lineedit.go | 16 |
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() } |
