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

Renormalize the redraw function

Have all instances take a function
Update the remaining modules to take this into account
Numerous smaller refactors to make some widgets work more or less the same
This commit is contained in:
Sean Smith
2019-08-27 21:51:37 -04:00
parent 67658e172c
commit 14e7619075
53 changed files with 209 additions and 182 deletions

View File

@@ -48,7 +48,7 @@ func (widget *Widget) Refresh() {
}
if err != nil {
widget.Redraw(widget.CommonSettings().Title, err.Error(), true)
widget.Redraw(func() (string, string, bool) { return widget.CommonSettings().Title, err.Error(), true })
return
}
var stories []Story
@@ -67,7 +67,7 @@ func (widget *Widget) Refresh() {
// Render sets up the widget data for redrawing to the screen
func (widget *Widget) Render() {
widget.RedrawFunc(widget.content)
widget.Redraw(widget.content)
}
/* -------------------- Unexported Functions -------------------- */