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

View File

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

View File

@ -254,7 +254,7 @@ func (s *sysData) setText(text string) {
} }
r := <-ret r := <-ret
if r.ret == 0 { // failure 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: case <-w.Closing:
break mainloop break mainloop
case <-b.Clicked: case <-b.Clicked:
err = w.SetTitle(fmt.Sprintf("%v | %s | %s | %s | %s", w.SetTitle(fmt.Sprintf("%v | %s | %s | %s | %s",
c.Checked(), c.Checked(),
cb1.Selection(), cb1.Selection(),
cb2.Selection(), cb2.Selection(),
e.Text(), e.Text(),
password.Text())) password.Text()))
if err != nil {
panic(err)
}
doAdjustments() doAdjustments()
case <-b2.Clicked: case <-b2.Clicked:
if cb1.Len() > 1 { if cb1.Len() > 1 {