From aa313bdaa412e7d43eb45bd883b59939d806a5d5 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 12 Apr 2019 05:25:55 -0700 Subject: [PATCH] WTF-389 Log an exception and terminate if widget config is invalid If, on startup, a widget's positional configuration is invalid (ie: cannot be displayed onscreen) then terminate the app and inform about which widget is erroring --- logger/log.go | 2 +- main.go | 19 +++++++++++++++---- modules/bamboohr/widget.go | 2 +- modules/circleci/widget.go | 2 +- modules/datadog/widget.go | 2 +- modules/gcal/display.go | 2 +- modules/gerrit/display.go | 2 +- modules/gerrit/widget.go | 2 +- modules/git/display.go | 2 +- modules/github/display.go | 2 +- modules/gitlab/display.go | 2 +- modules/gitter/widget.go | 6 +++--- modules/hackernews/widget.go | 4 ++-- modules/jenkins/widget.go | 4 ++-- modules/jira/widget.go | 4 ++-- modules/mercurial/display.go | 2 +- modules/nbascore/widget.go | 2 +- modules/newrelic/widget.go | 2 +- modules/opsgenie/widget.go | 2 +- modules/pagerduty/widget.go | 2 +- modules/rollbar/widget.go | 4 ++-- modules/todo/widget.go | 2 +- modules/travisci/widget.go | 4 ++-- modules/trello/widget.go | 4 ++-- modules/unknown/widget.go | 4 ++-- modules/victorops/widget.go | 2 +- modules/zendesk/widget.go | 2 +- wtf/bargraph.go | 27 +++++++++++++++++++-------- wtf/text_widget.go | 16 +++++++++++++--- wtf/wtfable.go | 2 ++ 30 files changed, 84 insertions(+), 50 deletions(-) diff --git a/logger/log.go b/logger/log.go index 084f6fe8..0e40dc0d 100644 --- a/logger/log.go +++ b/logger/log.go @@ -52,7 +52,7 @@ func (widget *Widget) Refresh() { return } - widget.View.SetTitle(widget.Name) + widget.View.SetTitle(widget.Name()) logLines := widget.tailFile() widget.View.SetText(widget.contentFrom(logLines)) diff --git a/main.go b/main.go index ac055346..a9f92bbd 100644 --- a/main.go +++ b/main.go @@ -151,6 +151,8 @@ func watchForConfigChanges(app *tview.Application, configFilePath string, grid * loadConfigFile(absPath) widgets := makeWidgets(app, pages) + validateWidgets(widgets) + initializeFocusTracker(app, widgets) display := wtf.NewDisplay(widgets) @@ -284,10 +286,7 @@ func makeWidgets(app *tview.Application, pages *tview.Pages) []wtf.Wtfable { for mod := range mods { if enabled := Config.UBool("wtf.mods."+mod+".enabled", false); enabled { widget := makeWidget(app, pages, mod) - - if widget.IsPositionable() { - widgets = append(widgets, widget) - } + widgets = append(widgets, widget) } } @@ -298,6 +297,16 @@ func makeWidgets(app *tview.Application, pages *tview.Pages) []wtf.Wtfable { return widgets } +// Check that all the loaded widgets are valid for display +func validateWidgets(widgets []wtf.Wtfable) { + for _, widget := range widgets { + if widget.Enabled() && !widget.IsPositionable() { + errStr := fmt.Sprintf("Widget config has invalid values: %s", widget.Key()) + log.Fatalln(errStr) + } + } +} + /* -------------------- Main -------------------- */ func main() { @@ -322,6 +331,8 @@ func main() { pages := tview.NewPages() widgets := makeWidgets(app, pages) + validateWidgets(widgets) + initializeFocusTracker(app, widgets) display := wtf.NewDisplay(widgets) diff --git a/modules/bamboohr/widget.go b/modules/bamboohr/widget.go index 464c06cd..a757e40a 100644 --- a/modules/bamboohr/widget.go +++ b/modules/bamboohr/widget.go @@ -40,7 +40,7 @@ func (widget *Widget) Refresh() { wtf.Now().Format(wtf.DateFormat), ) - widget.View.SetTitle(widget.ContextualTitle(widget.Name)) + widget.View.SetTitle(widget.ContextualTitle(widget.Name())) widget.View.SetText(widget.contentFrom(todayItems)) } diff --git a/modules/circleci/widget.go b/modules/circleci/widget.go index 62c4210e..7806d074 100644 --- a/modules/circleci/widget.go +++ b/modules/circleci/widget.go @@ -38,7 +38,7 @@ func (widget *Widget) Refresh() { builds, err := widget.Client.BuildsFor() - widget.View.SetTitle(fmt.Sprintf("%s - Builds", widget.Name)) + widget.View.SetTitle(fmt.Sprintf("%s - Builds", widget.Name())) var content string if err != nil { diff --git a/modules/datadog/widget.go b/modules/datadog/widget.go index 2d5d97f7..5ed2f9b9 100644 --- a/modules/datadog/widget.go +++ b/modules/datadog/widget.go @@ -25,7 +25,7 @@ func NewWidget(app *tview.Application) *Widget { func (widget *Widget) Refresh() { monitors, monitorErr := Monitors() - widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s", widget.Name))) + widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s", widget.Name()))) widget.View.Clear() var content string diff --git a/modules/gcal/display.go b/modules/gcal/display.go index f1157b19..af2b34c2 100644 --- a/modules/gcal/display.go +++ b/modules/gcal/display.go @@ -32,7 +32,7 @@ func (widget *Widget) display() { widget.mutex.Lock() defer widget.mutex.Unlock() - widget.View.SetTitle(widget.ContextualTitle(widget.Name)) + widget.View.SetTitle(widget.ContextualTitle(widget.Name())) widget.View.SetText(widget.contentFrom(widget.calEvents)) } diff --git a/modules/gerrit/display.go b/modules/gerrit/display.go index db704e12..770c3231 100644 --- a/modules/gerrit/display.go +++ b/modules/gerrit/display.go @@ -14,7 +14,7 @@ func (widget *Widget) display() { return } - widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s- %s", widget.Name, widget.title(project)))) + widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s- %s", widget.Name(), widget.title(project)))) str := wtf.SigilStr(len(widget.GerritProjects), widget.Idx, widget.View) + "\n" str = str + " [red]Stats[white]\n" diff --git a/modules/gerrit/widget.go b/modules/gerrit/widget.go index 051c7f02..6fcdaee9 100644 --- a/modules/gerrit/widget.go +++ b/modules/gerrit/widget.go @@ -94,7 +94,7 @@ func (widget *Widget) Refresh() { gerrit, err := glb.NewClient(gerritUrl, httpClient) if err != nil { widget.View.SetWrap(true) - widget.View.SetTitle(widget.Name) + widget.View.SetTitle(widget.Name()) widget.View.SetText(err.Error()) return } diff --git a/modules/git/display.go b/modules/git/display.go index 1086d081..546b3f6e 100644 --- a/modules/git/display.go +++ b/modules/git/display.go @@ -15,7 +15,7 @@ func (widget *Widget) display() { return } - title := fmt.Sprintf("%s - [green]%s[white]", widget.Name, repoData.Repository) + title := fmt.Sprintf("%s - [green]%s[white]", widget.Name(), repoData.Repository) widget.View.SetTitle(widget.ContextualTitle(title)) str := wtf.SigilStr(len(widget.GitRepos), widget.Idx, widget.View) + "\n" diff --git a/modules/github/display.go b/modules/github/display.go index 940e12fc..556f38a3 100644 --- a/modules/github/display.go +++ b/modules/github/display.go @@ -14,7 +14,7 @@ func (widget *Widget) display() { return } - widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - %s", widget.Name, widget.title(repo)))) + widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - %s", widget.Name(), widget.title(repo)))) str := wtf.SigilStr(len(widget.GithubRepos), widget.Idx, widget.View) + "\n" str = str + " [red]Stats[white]\n" diff --git a/modules/gitlab/display.go b/modules/gitlab/display.go index 0c8028cf..3899d7f2 100644 --- a/modules/gitlab/display.go +++ b/modules/gitlab/display.go @@ -14,7 +14,7 @@ func (widget *Widget) display() { return } - widget.View.SetTitle(fmt.Sprintf("%s- %s", widget.Name, widget.title(project))) + widget.View.SetTitle(fmt.Sprintf("%s- %s", widget.Name(), widget.title(project))) str := wtf.SigilStr(len(widget.GitlabProjects), widget.Idx, widget.View) + "\n" str = str + " [red]Stats[white]\n" diff --git a/modules/gitter/widget.go b/modules/gitter/widget.go index cb15cd0b..89dbb03a 100644 --- a/modules/gitter/widget.go +++ b/modules/gitter/widget.go @@ -54,7 +54,7 @@ func (widget *Widget) Refresh() { room, err := GetRoom(wtf.Config.UString("wtf.mods.gitter.roomUri", "wtfutil/Lobby")) if err != nil { widget.View.SetWrap(true) - widget.View.SetTitle(widget.Name) + widget.View.SetTitle(widget.Name()) widget.View.SetText(err.Error()) return } @@ -67,7 +67,7 @@ func (widget *Widget) Refresh() { if err != nil { widget.View.SetWrap(true) - widget.View.SetTitle(widget.Name) + widget.View.SetTitle(widget.Name()) widget.View.SetText(err.Error()) } else { widget.messages = messages @@ -86,7 +86,7 @@ func (widget *Widget) display() { widget.View.SetWrap(true) widget.View.Clear() - widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - %s", widget.Name, wtf.Config.UString("wtf.mods.gitter.roomUri", "wtfutil/Lobby")))) + widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - %s", widget.Name(), wtf.Config.UString("wtf.mods.gitter.roomUri", "wtfutil/Lobby")))) widget.View.SetText(widget.contentFrom(widget.messages)) widget.View.Highlight(strconv.Itoa(widget.selected)).ScrollToHighlight() } diff --git a/modules/hackernews/widget.go b/modules/hackernews/widget.go index 8600e5c4..be19ab36 100644 --- a/modules/hackernews/widget.go +++ b/modules/hackernews/widget.go @@ -64,7 +64,7 @@ func (widget *Widget) Refresh() { if err != nil { widget.View.SetWrap(true) - widget.View.SetTitle(widget.Name) + widget.View.SetTitle(widget.Name()) widget.View.SetText(err.Error()) } else { var stories []Story @@ -94,7 +94,7 @@ func (widget *Widget) display() { widget.View.SetWrap(false) widget.View.Clear() - widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - %sstories", widget.Name, wtf.Config.UString("wtf.mods.hackernews.storyType", "top")))) + widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - %sstories", widget.Name(), wtf.Config.UString("wtf.mods.hackernews.storyType", "top")))) widget.View.SetText(widget.contentFrom(widget.stories)) widget.View.Highlight(strconv.Itoa(widget.selected)).ScrollToHighlight() } diff --git a/modules/jenkins/widget.go b/modules/jenkins/widget.go index 9aa70824..23e6d16e 100644 --- a/modules/jenkins/widget.go +++ b/modules/jenkins/widget.go @@ -63,7 +63,7 @@ func (widget *Widget) Refresh() { if err != nil { widget.View.SetWrap(true) - widget.View.SetTitle(widget.ContextualTitle(widget.Name)) + widget.View.SetTitle(widget.ContextualTitle(widget.Name())) widget.View.SetText(err.Error()) } @@ -80,7 +80,7 @@ func (widget *Widget) display() { widget.View.SetWrap(false) widget.View.Clear() - widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s: [red]%s", widget.Name, widget.view.Name))) + widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s: [red]%s", widget.Name(), widget.view.Name))) widget.View.SetText(widget.contentFrom(widget.view)) widget.View.Highlight(strconv.Itoa(widget.selected)).ScrollToHighlight() } diff --git a/modules/jira/widget.go b/modules/jira/widget.go index cd9f80f2..ef260a12 100644 --- a/modules/jira/widget.go +++ b/modules/jira/widget.go @@ -57,7 +57,7 @@ func (widget *Widget) Refresh() { if err != nil { widget.result = nil widget.View.SetWrap(true) - widget.View.SetTitle(widget.Name) + widget.View.SetTitle(widget.Name()) widget.View.SetText(err.Error()) } else { widget.result = searchResult @@ -74,7 +74,7 @@ func (widget *Widget) display() { } widget.View.SetWrap(false) - str := fmt.Sprintf("%s- [green]%s[white]", widget.Name, wtf.Config.UString("wtf.mods.jira.project")) + str := fmt.Sprintf("%s- [green]%s[white]", widget.Name(), wtf.Config.UString("wtf.mods.jira.project")) widget.View.Clear() widget.View.SetTitle(widget.ContextualTitle(str)) diff --git a/modules/mercurial/display.go b/modules/mercurial/display.go index 87f287ed..724baddb 100644 --- a/modules/mercurial/display.go +++ b/modules/mercurial/display.go @@ -15,7 +15,7 @@ func (widget *Widget) display() { return } - title := fmt.Sprintf("%s - [green]%s[white]", widget.Name, repoData.Repository) + title := fmt.Sprintf("%s - [green]%s[white]", widget.Name(), repoData.Repository) widget.View.SetTitle(widget.ContextualTitle(title)) str := wtf.SigilStr(len(widget.Data), widget.Idx, widget.View) + "\n" diff --git a/modules/nbascore/widget.go b/modules/nbascore/widget.go index 4231fcc1..242decb9 100644 --- a/modules/nbascore/widget.go +++ b/modules/nbascore/widget.go @@ -47,7 +47,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages) *Widget { func (widget *Widget) Refresh() { widget.nbascore() - widget.View.SetTitle(widget.ContextualTitle(widget.Name)) + widget.View.SetTitle(widget.ContextualTitle(widget.Name())) } func (widget *Widget) nbascore() { diff --git a/modules/newrelic/widget.go b/modules/newrelic/widget.go index a8ee6950..591426c5 100644 --- a/modules/newrelic/widget.go +++ b/modules/newrelic/widget.go @@ -34,7 +34,7 @@ func (widget *Widget) Refresh() { appName = app.Name } - widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - [green]%s[white]", widget.Name, appName))) + widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - [green]%s[white]", widget.Name(), appName))) widget.View.Clear() var content string diff --git a/modules/opsgenie/widget.go b/modules/opsgenie/widget.go index 50f509f8..717c5f34 100644 --- a/modules/opsgenie/widget.go +++ b/modules/opsgenie/widget.go @@ -27,7 +27,7 @@ func (widget *Widget) Refresh() { wtf.Config.UString("wtf.mods.opsgenie.scheduleIdentifierType"), getSchedules(), ) - widget.View.SetTitle(widget.ContextualTitle(widget.Name)) + widget.View.SetTitle(widget.ContextualTitle(widget.Name())) var content string if err != nil { diff --git a/modules/pagerduty/widget.go b/modules/pagerduty/widget.go index 5bfea9a5..469abbdb 100644 --- a/modules/pagerduty/widget.go +++ b/modules/pagerduty/widget.go @@ -38,7 +38,7 @@ func (widget *Widget) Refresh() { incidents, err2 = GetIncidents() } - widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s", widget.Name))) + widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s", widget.Name()))) widget.View.Clear() var content string diff --git a/modules/rollbar/widget.go b/modules/rollbar/widget.go index 0e836408..e1f34204 100644 --- a/modules/rollbar/widget.go +++ b/modules/rollbar/widget.go @@ -55,7 +55,7 @@ func (widget *Widget) Refresh() { if err != nil { widget.View.SetWrap(true) - widget.View.SetTitle(widget.Name) + widget.View.SetTitle(widget.Name()) widget.View.SetText(err.Error()) } else { widget.items = &items.Results @@ -73,7 +73,7 @@ func (widget *Widget) display() { widget.View.SetWrap(false) projectName := wtf.Config.UString("wtf.mods.rollbar.projectName", "Items") - widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - %s", widget.Name, projectName))) + widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - %s", widget.Name(), projectName))) widget.View.SetText(widget.contentFrom(widget.items)) } diff --git a/modules/todo/widget.go b/modules/todo/widget.go index 1553921b..5f0abeba 100644 --- a/modules/todo/widget.go +++ b/modules/todo/widget.go @@ -72,7 +72,7 @@ func (widget *Widget) Refresh() { widget.load() widget.display() - widget.View.SetTitle(widget.ContextualTitle(widget.Name)) + widget.View.SetTitle(widget.ContextualTitle(widget.Name())) } func (widget *Widget) SetList(newList checklist.Checklist) { diff --git a/modules/travisci/widget.go b/modules/travisci/widget.go index 9ab5ecc8..8844fcaf 100644 --- a/modules/travisci/widget.go +++ b/modules/travisci/widget.go @@ -55,7 +55,7 @@ func (widget *Widget) Refresh() { if err != nil { widget.View.SetWrap(true) - widget.View.SetTitle(widget.Name) + widget.View.SetTitle(widget.Name()) widget.View.SetText(err.Error()) } else { widget.builds = builds @@ -73,7 +73,7 @@ func (widget *Widget) display() { widget.View.SetWrap(false) - widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - Builds", widget.Name))) + widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - Builds", widget.Name()))) widget.View.SetText(widget.contentFrom(widget.builds)) } diff --git a/modules/trello/widget.go b/modules/trello/widget.go index 96b017d8..61ddf0cc 100644 --- a/modules/trello/widget.go +++ b/modules/trello/widget.go @@ -35,14 +35,14 @@ func (widget *Widget) Refresh() { var content string if err != nil { widget.View.SetWrap(true) - widget.View.SetTitle(widget.Name) + widget.View.SetTitle(widget.Name()) content = err.Error() } else { widget.View.SetWrap(false) widget.View.SetTitle( fmt.Sprintf( "[white]%s: [green]%s ", - widget.Name, + widget.Name(), wtf.Config.UString("wtf.mods.trello.board"), ), ) diff --git a/modules/unknown/widget.go b/modules/unknown/widget.go index 76ffe6b1..88653d90 100644 --- a/modules/unknown/widget.go +++ b/modules/unknown/widget.go @@ -23,9 +23,9 @@ func NewWidget(app *tview.Application, name string) *Widget { func (widget *Widget) Refresh() { - widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s", widget.Name))) + widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s", widget.Name()))) widget.View.Clear() - content := fmt.Sprintf("Widget %s does not exist", widget.Name) + content := fmt.Sprintf("Widget %s does not exist", widget.Name()) widget.View.SetText(content) } diff --git a/modules/victorops/widget.go b/modules/victorops/widget.go index 0a9dac06..a4de256f 100644 --- a/modules/victorops/widget.go +++ b/modules/victorops/widget.go @@ -41,7 +41,7 @@ func (widget *Widget) Refresh() { } teams, err := Fetch() - widget.View.SetTitle(widget.ContextualTitle(widget.Name)) + widget.View.SetTitle(widget.ContextualTitle(widget.Name())) if err != nil { widget.View.SetWrap(true) diff --git a/modules/zendesk/widget.go b/modules/zendesk/widget.go index 7d1b08ab..153a954f 100644 --- a/modules/zendesk/widget.go +++ b/modules/zendesk/widget.go @@ -43,7 +43,7 @@ func (widget *Widget) Refresh() { /* -------------------- Unexported Functions -------------------- */ func (widget *Widget) display() { - widget.View.SetTitle(fmt.Sprintf("%s (%d)", widget.Name, widget.result.Count)) + widget.View.SetTitle(fmt.Sprintf("%s (%d)", widget.Name(), widget.result.Count)) widget.View.SetText(widget.textContent(widget.result.Tickets)) } diff --git a/wtf/bargraph.go b/wtf/bargraph.go index ebfa7486..cc00887e 100644 --- a/wtf/bargraph.go +++ b/wtf/bargraph.go @@ -9,11 +9,13 @@ import ( //BarGraph lets make graphs type BarGraph struct { - enabled bool - focusable bool - starChar string - maxStars int - Name string + enabled bool + focusable bool + key string + maxStars int + name string + starChar string + RefreshInt int View *tview.TextView @@ -31,9 +33,10 @@ func NewBarGraph(app *tview.Application, name string, configKey string, focusabl widget := BarGraph{ enabled: Config.UBool(fmt.Sprintf("wtf.mods.%s.enabled", configKey), false), focusable: focusable, - starChar: Config.UString(fmt.Sprintf("wtf.mods.%s.graphIcon", configKey), "|"), + key: configKey, maxStars: Config.UInt(fmt.Sprintf("wtf.mods.%s.graphStars", configKey), 20), - Name: Config.UString(fmt.Sprintf("wtf.mods.%s.title", configKey), name), + name: Config.UString(fmt.Sprintf("wtf.mods.%s.title", configKey), name), + starChar: Config.UString(fmt.Sprintf("wtf.mods.%s.graphIcon", configKey), "|"), RefreshInt: Config.UInt(fmt.Sprintf("wtf.mods.%s.refreshInterval", configKey), 1), } @@ -83,6 +86,14 @@ func (widget *BarGraph) IsPositionable() bool { return widget.Position.IsValid() } +func (widget *BarGraph) Key() string { + return widget.key +} + +func (widget *BarGraph) Name() string { + return widget.name +} + func (widget *BarGraph) RefreshInterval() int { return widget.RefreshInt } @@ -104,7 +115,7 @@ func (widget *BarGraph) addView(app *tview.Application, configKey string) { view.SetBorder(true) view.SetBorderColor(ColorFor(widget.BorderColor())) view.SetDynamicColors(true) - view.SetTitle(widget.Name) + view.SetTitle(widget.Name()) view.SetTitleColor(ColorFor( Config.UString( fmt.Sprintf("wtf.mods.%s.colors.title", configKey), diff --git a/wtf/text_widget.go b/wtf/text_widget.go index 82bd1946..74ead21f 100644 --- a/wtf/text_widget.go +++ b/wtf/text_widget.go @@ -13,8 +13,9 @@ type TextWidget struct { enabled bool focusable bool focusChar string + key string + name string - Name string RefreshInt int View *tview.TextView @@ -32,7 +33,8 @@ func NewTextWidget(app *tview.Application, name string, configKey string, focusa enabled: Config.UBool(fmt.Sprintf("wtf.mods.%s.enabled", configKey), false), focusable: focusable, focusChar: focusChar, - Name: Config.UString(fmt.Sprintf("wtf.mods.%s.title", configKey), name), + key: configKey, + name: Config.UString(fmt.Sprintf("wtf.mods.%s.title", configKey), name), RefreshInt: Config.UInt(fmt.Sprintf("wtf.mods.%s.refreshInterval", configKey)), } @@ -92,6 +94,14 @@ func (widget *TextWidget) IsPositionable() bool { return widget.Position.IsValid() } +func (widget *TextWidget) Key() string { + return widget.key +} + +func (widget *TextWidget) Name() string { + return widget.name +} + func (widget *TextWidget) RefreshInterval() int { return widget.RefreshInt } @@ -135,7 +145,7 @@ func (widget *TextWidget) addView(app *tview.Application, configKey string) { app.Draw() }) view.SetDynamicColors(true) - view.SetTitle(widget.ContextualTitle(widget.Name)) + view.SetTitle(widget.ContextualTitle(widget.name)) view.SetWrap(false) widget.View = view diff --git a/wtf/wtfable.go b/wtf/wtfable.go index 973db6c6..86e33121 100644 --- a/wtf/wtfable.go +++ b/wtf/wtfable.go @@ -11,6 +11,8 @@ type Wtfable interface { BorderColor() string Focusable() bool FocusChar() string + Key() string + Name() string SetFocusChar(string) TextView() *tview.TextView