Removed error returns from [all controls].SetText() and Window.SetTitle().

This commit is contained in:
Pietro Gagliardi 2014-03-10 10:45:15 -04:00
parent 353c949f64
commit a68bdec2fd
5 changed files with 15 additions and 19 deletions

View File

@ -27,15 +27,15 @@ func NewButton(text string) (b *Button) {
} }
// SetText sets the button's text. // SetText sets the button's text.
func (b *Button) SetText(text string) (err error) { func (b *Button) SetText(text string) {
b.lock.Lock() b.lock.Lock()
defer b.lock.Unlock() defer b.lock.Unlock()
if b.created { if b.created {
return b.sysData.setText(text) b.sysData.setText(text)
return
} }
b.initText = text b.initText = text
return nil
} }
// Text returns the button's text. // Text returns the button's text.

View File

@ -25,15 +25,15 @@ func NewCheckbox(text string) (c *Checkbox) {
} }
// SetText sets the checkbox's text. // SetText sets the checkbox's text.
func (c *Checkbox) SetText(text string) (err error) { func (c *Checkbox) SetText(text string) {
c.lock.Lock() c.lock.Lock()
defer c.lock.Unlock() defer c.lock.Unlock()
if c.created { if c.created {
return c.sysData.setText(text) c.sysData.setText(text)
return
} }
c.initText = text c.initText = text
return nil
} }
// Text returns the checkbox's text. // Text returns the checkbox's text.

View File

@ -22,15 +22,15 @@ func NewLabel(text string) *Label {
} }
// SetText sets the Label's text. // SetText sets the Label's text.
func (l *Label) SetText(text string) (err error) { func (l *Label) SetText(text string) {
l.lock.Lock() l.lock.Lock()
defer l.lock.Unlock() defer l.lock.Unlock()
if l.created { if l.created {
return l.sysData.setText(text) l.sysData.setText(text)
return
} }
l.initText = text l.initText = text
return nil
} }
// Text returns the Label's text. // Text returns the Label's text.

View File

@ -33,15 +33,15 @@ func NewPasswordEdit() *LineEdit {
} }
// SetText sets the LineEdit's text. // SetText sets the LineEdit's text.
func (l *LineEdit) SetText(text string) (err error) { func (l *LineEdit) SetText(text string) {
l.lock.Lock() l.lock.Lock()
defer l.lock.Unlock() defer l.lock.Unlock()
if l.created { if l.created {
return l.sysData.setText(text) l.sysData.setText(text)
return
} }
l.initText = text l.initText = text
return nil
} }
// Text returns the LineEdit's text. // Text returns the LineEdit's text.

View File

@ -31,19 +31,15 @@ func NewWindow(title string, width int, height int) *Window {
} }
// SetTitle sets the window's title. // SetTitle sets the window's title.
func (w *Window) SetTitle(title string) (err error) { func (w *Window) SetTitle(title string) {
w.lock.Lock() w.lock.Lock()
defer w.lock.Unlock() defer w.lock.Unlock()
if w.created { if w.created {
err = w.sysData.setText(title) w.sysData.setText(title)
if err != nil { return
return fmt.Errorf("error setting window title: %v", err)
}
return nil
} }
w.initTitle = title w.initTitle = title
return nil
} }
// SetSize sets the window's size. // SetSize sets the window's size.