mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Status and weather refresh on a global interval
This commit is contained in:
committed by
Chris Cummer
parent
8a258225c9
commit
69e0034871
@@ -2,6 +2,7 @@ package status
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
@@ -28,6 +29,7 @@ func (widget *Widget) Refresh() {
|
||||
widget.View.SetTitle(" 🦊 Status ")
|
||||
widget.RefreshedAt = time.Now()
|
||||
|
||||
widget.View.Clear()
|
||||
fmt.Fprintf(widget.View, "%s", widget.contentFrom())
|
||||
}
|
||||
|
||||
@@ -44,5 +46,6 @@ func (widget *Widget) addView() {
|
||||
}
|
||||
|
||||
func (widget *Widget) contentFrom() string {
|
||||
return "cats and gods\ndogs and tacs"
|
||||
//return "cats and gods\ndogs and tacs"
|
||||
return fmt.Sprint(rand.Intn(100))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user