diff options
author | Caleb Bassi <calebjbassi@gmail.com> | 2018-04-12 19:43:17 -0700 |
---|---|---|
committer | Caleb Bassi <calebjbassi@gmail.com> | 2018-04-12 19:43:17 -0700 |
commit | 6b5db0cd092acf97e396f3d2484fd7f944fec92c (patch) | |
tree | 7a7b4d7daa727960f8ecdf3e9f94b1d27f3f8923 /widgets | |
parent | f6a100608a9a77508d9787a817d2c70a49c4f9cb (diff) |
Async widget initialization
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/proc.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/widgets/proc.go b/widgets/proc.go index 0421d54..cd48219 100644 --- a/widgets/proc.go +++ b/widgets/proc.go @@ -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() { |