Async widget initialization

This commit is contained in:
Caleb Bassi
2018-04-12 19:43:17 -07:00
parent f6a100608a
commit 6b5db0cd09
2 changed files with 36 additions and 15 deletions

View File

@ -35,7 +35,7 @@ type Proc struct {
KeyPressed chan bool
}
func NewProc(loaded, keyPressed chan bool) *Proc {
func NewProc(keyPressed chan bool) *Proc {
cpuCount, _ := psCPU.Counts(false)
self := &Proc{
Table: ui.NewTable(),
@ -56,10 +56,7 @@ func NewProc(loaded, keyPressed chan bool) *Proc {
self.keyBinds()
go func() {
self.update()
loaded <- true
}()
self.update()
ticker := time.NewTicker(self.interval)
go func() {