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

Add focusable title to NBA Scores module

This commit is contained in:
Chris Cummer
2019-03-07 05:47:32 -08:00
parent c5d21bc084
commit 27a806ae6d
2 changed files with 9 additions and 5 deletions

View File

@@ -14,9 +14,9 @@ import (
const HelpText = `
Keyboard commands for NBA Score:
h: Go to previous day
l: Go to next day
c: Go back to current day
h: Go to previous day
l: Go to next day
c: Go back to current day
`
type Widget struct {
@@ -35,15 +35,19 @@ func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
HelpfulWidget: wtf.NewHelpfulWidget(app, pages, HelpText),
TextWidget: wtf.NewTextWidget(app, "NBA Score", "nbascore", true),
}
widget.HelpfulWidget.SetView(widget.View)
widget.TextWidget.RefreshInt = 15
widget.View.SetInputCapture(widget.keyboardIntercept)
widget.View.SetScrollable(true)
return &widget
}
func (widget *Widget) Refresh() {
widget.nbascore()
widget.View.SetTitle(widget.ContextualTitle(widget.Name))
}
func (widget *Widget) nbascore() {