From a68bdec2fd8a23230ed12348c3801d349b19dea2 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 10 Mar 2014 10:45:15 -0400 Subject: [PATCH] Removed error returns from [all controls].SetText() and Window.SetTitle(). --- button.go | 6 +++--- checkbox.go | 6 +++--- label.go | 6 +++--- lineedit.go | 6 +++--- window.go | 10 +++------- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/button.go b/button.go index 325a556..195ebb3 100644 --- a/button.go +++ b/button.go @@ -27,15 +27,15 @@ func NewButton(text string) (b *Button) { } // SetText sets the button's text. -func (b *Button) SetText(text string) (err error) { +func (b *Button) SetText(text string) { b.lock.Lock() defer b.lock.Unlock() if b.created { - return b.sysData.setText(text) + b.sysData.setText(text) + return } b.initText = text - return nil } // Text returns the button's text. diff --git a/checkbox.go b/checkbox.go index 2b2a71a..037588d 100644 --- a/checkbox.go +++ b/checkbox.go @@ -25,15 +25,15 @@ func NewCheckbox(text string) (c *Checkbox) { } // SetText sets the checkbox's text. -func (c *Checkbox) SetText(text string) (err error) { +func (c *Checkbox) SetText(text string) { c.lock.Lock() defer c.lock.Unlock() if c.created { - return c.sysData.setText(text) + c.sysData.setText(text) + return } c.initText = text - return nil } // Text returns the checkbox's text. diff --git a/label.go b/label.go index be19949..6b91f75 100644 --- a/label.go +++ b/label.go @@ -22,15 +22,15 @@ func NewLabel(text string) *Label { } // SetText sets the Label's text. -func (l *Label) SetText(text string) (err error) { +func (l *Label) SetText(text string) { l.lock.Lock() defer l.lock.Unlock() if l.created { - return l.sysData.setText(text) + l.sysData.setText(text) + return } l.initText = text - return nil } // Text returns the Label's text. diff --git a/lineedit.go b/lineedit.go index 98617a5..4234f7f 100644 --- a/lineedit.go +++ b/lineedit.go @@ -33,15 +33,15 @@ func NewPasswordEdit() *LineEdit { } // SetText sets the LineEdit's text. -func (l *LineEdit) SetText(text string) (err error) { +func (l *LineEdit) SetText(text string) { l.lock.Lock() defer l.lock.Unlock() if l.created { - return l.sysData.setText(text) + l.sysData.setText(text) + return } l.initText = text - return nil } // Text returns the LineEdit's text. diff --git a/window.go b/window.go index 22c2951..946138e 100644 --- a/window.go +++ b/window.go @@ -31,19 +31,15 @@ func NewWindow(title string, width int, height int) *Window { } // SetTitle sets the window's title. -func (w *Window) SetTitle(title string) (err error) { +func (w *Window) SetTitle(title string) { w.lock.Lock() defer w.lock.Unlock() if w.created { - err = w.sysData.setText(title) - if err != nil { - return fmt.Errorf("error setting window title: %v", err) - } - return nil + w.sysData.setText(title) + return } w.initTitle = title - return nil } // SetSize sets the window's size.