Fixed compiler errors in the previous few commits.

This commit is contained in:
Pietro Gagliardi 2014-03-10 11:06:07 -04:00
parent a68bdec2fd
commit 699f786cd5
4 changed files with 7 additions and 16 deletions

View File

@ -306,10 +306,7 @@ func (s *sysData) make(initText string, window *sysData) error {
ret <- ct.make(parentWindow, s.alternate)
}
s.id = <-ret
err := s.setText(initText)
if err != nil {
return fmt.Errorf("error setting initial text of new window/control: %v", err)
}
s.setText(initText)
addSysData(s.id, s)
return nil
}
@ -344,7 +341,7 @@ func (s *sysData) setText(text string) {
var zeroSel C.SEL
if classTypes[s.ctype].settextsel == zeroSel { // does not have concept of text
return nil
return
}
ret := make(chan struct{})
defer close(ret)

View File

@ -4,7 +4,7 @@
package ui
import (
"fmt"
// ...
)
type sysData struct {
@ -150,10 +150,7 @@ func (s *sysData) make(initText string, window *sysData) error {
}
<-ret
}
err := s.setText(initText)
if err != nil {
return fmt.Errorf("error setting initial text of new window/control: %v", err)
}
s.setText(initText)
return nil
}
@ -185,7 +182,7 @@ func (s *sysData) hide() {
func (s *sysData) setText(text string) {
if classTypes[s.ctype].setText == nil { // does not have concept of text
return nil
return
}
ret := make(chan struct{})
defer close(ret)

View File

@ -254,7 +254,7 @@ func (s *sysData) setText(text string) {
}
r := <-ret
if r.ret == 0 { // failure
panic(fmt.Errorf("error setting window/control text: %v", err))
panic(fmt.Errorf("error setting window/control text: %v", r.err))
}
}

View File

@ -140,15 +140,12 @@ mainloop:
case <-w.Closing:
break mainloop
case <-b.Clicked:
err = w.SetTitle(fmt.Sprintf("%v | %s | %s | %s | %s",
w.SetTitle(fmt.Sprintf("%v | %s | %s | %s | %s",
c.Checked(),
cb1.Selection(),
cb2.Selection(),
e.Text(),
password.Text()))
if err != nil {
panic(err)
}
doAdjustments()
case <-b2.Clicked:
if cb1.Len() > 1 {