From 0e8680c04f3b364352a57e686bc93d018c6140e3 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 17 Mar 2014 14:09:09 -0400 Subject: Dumped the mutex locks from the other controls and elaborated/asked for help in the README. --- lineedit.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'lineedit.go') 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() } -- cgit v1.2.3