moved event and draw loops to Start method
This commit is contained in:
parent
0af1f0fde6
commit
e0874e6e4c
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user