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

BaseWidget added to start reducing some of the code duplication

This commit is contained in:
Chris Cummer
2018-03-30 22:29:19 -07:00
committed by Chris Cummer
parent a09691c86f
commit b937d64d75
5 changed files with 36 additions and 22 deletions

View File

@@ -6,21 +6,22 @@ import (
"time"
"github.com/rivo/tview"
"github.com/senorprogrammer/wtf/wtf"
"google.golang.org/api/calendar/v3"
)
type Widget struct {
Name string
RefreshedAt time.Time
RefreshInterval int
View *tview.TextView
wtf.BaseWidget
View *tview.TextView
}
func NewWidget() *Widget {
widget := Widget{
Name: "Calendar",
RefreshedAt: time.Now(),
RefreshInterval: 60,
BaseWidget: wtf.BaseWidget{
Name: "Calendar",
RefreshedAt: time.Now(),
RefreshInterval: 60,
},
}
widget.addView()