Init function can return an error.
This commit is contained in:
parent
7f9f10075f
commit
6a71720b71
@ -24,5 +24,5 @@ type Control interface {
|
||||
type RootControl interface {
|
||||
Control
|
||||
|
||||
Init(Context)
|
||||
Init(Context) error
|
||||
}
|
||||
|
5
ui/ui.go
5
ui/ui.go
@ -16,7 +16,10 @@ func RunWait(r Renderer, s *Style, view Control, wait bool) error {
|
||||
ctx := &context{r: r, style: s, view: view, ims: NewImages(r)}
|
||||
root, ok := view.(RootControl)
|
||||
if ok {
|
||||
root.Init(ctx)
|
||||
err := root.Init(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
anim := time.NewTicker(30 * time.Millisecond)
|
||||
go func() {
|
||||
|
Loading…
Reference in New Issue
Block a user