From e0874e6e4c43dbf3cdddb272ef5a04c0494aa95e Mon Sep 17 00:00:00 2001 From: milarin Date: Mon, 24 Apr 2023 14:16:12 +0200 Subject: [PATCH] moved event and draw loops to Start method --- screen.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/screen.go b/screen.go index 1f38569..be2e617 100644 --- a/screen.go +++ b/screen.go @@ -41,9 +41,6 @@ func NewScreen(root View) (*Screen, error) { s.KeyPressed = CloseOnCtrlC(s) - go s.eventloop() - go s.drawloop() - return s, nil } @@ -57,6 +54,10 @@ func (s *Screen) Start() error { defer close(s.redrawCh) s.scr.EnableMouse() + + go s.eventloop() + go s.drawloop() + s.started = true return <-s.stopCh }