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:
committed by
Chris Cummer
parent
a09691c86f
commit
b937d64d75
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user