1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Merge branch 'master' into addLogging

This commit is contained in:
Bill Keenan
2018-06-07 16:02:54 -07:00
committed by GitHub
4 changed files with 64 additions and 25 deletions

View File

@@ -9,7 +9,7 @@ type Scheduler interface {
RefreshInterval() int
}
func Schedule(widget Scheduler) {
func Schedule(widget Wtfable) {
// Kick off the first refresh and then leave the rest to the timer
widget.Refresh()
@@ -25,7 +25,12 @@ func Schedule(widget Scheduler) {
for {
select {
case <-tick.C:
widget.Refresh()
if widget.Enabled() {
widget.Refresh()
} else {
tick.Stop()
return
}
case <-quit:
tick.Stop()
return