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

Widgets have names

This commit is contained in:
Chris Cummer
2018-03-30 10:21:05 -07:00
committed by Chris Cummer
parent ab4774c86a
commit 2f63a56eae
5 changed files with 9 additions and 33 deletions

View File

@@ -10,6 +10,7 @@ import (
)
type Widget struct {
Name string
RefreshedAt time.Time
RefreshInterval int
View *tview.TextView
@@ -17,6 +18,7 @@ type Widget struct {
func NewWidget() *Widget {
widget := Widget{
Name: "Calendar",
RefreshedAt: time.Now(),
RefreshInterval: 1800,
}
@@ -45,7 +47,7 @@ func (widget *Widget) addView() {
view.SetBorder(true)
view.SetDynamicColors(true)
view.SetTitle(" Calendar ")
view.SetTitle(widget.Name)
widget.View = view
}