diff --git a/ui/control.go b/ui/control.go index c74d3ec..7ad5068 100644 --- a/ui/control.go +++ b/ui/control.go @@ -24,5 +24,5 @@ type Control interface { type RootControl interface { Control - Init(Context) + Init(Context) error } diff --git a/ui/ui.go b/ui/ui.go index 6a847d8..c1e36bd 100644 --- a/ui/ui.go +++ b/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() {