More TODO reduction.

This commit is contained in:
Pietro Gagliardi 2014-02-15 15:38:41 -05:00
parent 900ec4e715
commit 1bb2371e8d
4 changed files with 4 additions and 9 deletions

View File

@ -24,7 +24,6 @@ func NewLabel(text string) *Label {
// TODO SetText()/Text()? // TODO SetText()/Text()?
// TODO adorn error messages
func (l *Label) make(window *sysData) error { func (l *Label) make(window *sysData) error {
l.lock.Lock() l.lock.Lock()
defer l.lock.Unlock() defer l.lock.Unlock()

View File

@ -37,7 +37,6 @@ func (l *LineEdit) Text() string {
return l.initText return l.initText
} }
// TODO adorn errors with what failed
func (l *LineEdit) make(window *sysData) error { func (l *LineEdit) make(window *sysData) error {
l.lock.Lock() l.lock.Lock()
defer l.lock.Unlock() defer l.lock.Unlock()

View File

@ -32,19 +32,17 @@ func NewStack(o Orientation, controls ...Control) *Stack {
} }
} }
// TODO adorn errors with which stage failed
func (s *Stack) make(window *sysData) error { func (s *Stack) make(window *sysData) error {
for _, c := range s.controls { for i, c := range s.controls {
err := c.make(window) err := c.make(window)
if err != nil { if err != nil {
return err return fmt.Errorf("error adding control %d: %v", i, err)
} }
} }
s.created = true s.created = true
return nil return nil
} }
// TODO adorn errors with which stage failed
func (s *Stack) setRect(x int, y int, width int, height int) error { func (s *Stack) setRect(x int, y int, width int, height int) error {
var dx, dy int var dx, dy int
@ -61,10 +59,10 @@ func (s *Stack) setRect(x int, y int, width int, height int) error {
default: default:
panic(fmt.Sprintf("invalid orientation %d given to Stack.setRect()", s.orientation)) panic(fmt.Sprintf("invalid orientation %d given to Stack.setRect()", s.orientation))
} }
for _, c := range s.controls { for i, c := range s.controls {
err := c.setRect(x, y, width, height) err := c.setRect(x, y, width, height)
if err != nil { if err != nil {
return err return fmt.Errorf("error setting size of control %d: %v", i, err)
} }
x += dx x += dx
y += dy y += dy

View File

@ -35,7 +35,6 @@ far off:
- localization - localization
- strip unused constants from the Windows files - strip unused constants from the Windows files
- combine more Windows files; rename some? - combine more Windows files; rename some?
- normalize error handling to adorn errors with function call information
maybe: maybe:
- rename Stack to Box? - rename Stack to Box?