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

WTF-1031 WIP

Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
Chris Cummer
2020-12-02 13:52:40 -08:00
parent 58318212f8
commit aae98e40e3
6 changed files with 83 additions and 10 deletions

View File

@@ -14,6 +14,8 @@ type TextWidget struct {
*KeyboardWidget
View *tview.TextView
tviewApp *tview.Application
}
// NewTextWidget creates and returns an instance of TextWidget
@@ -21,6 +23,8 @@ func NewTextWidget(tviewApp *tview.Application, pages *tview.Pages, commonSettin
widget := TextWidget{
Base: NewBase(commonSettings),
KeyboardWidget: NewKeyboardWidget(tviewApp, pages, commonSettings),
tviewApp: tviewApp,
}
widget.View = widget.createView(widget.bordered)
@@ -39,6 +43,7 @@ func (widget *TextWidget) TextView() *tview.TextView {
}
func (widget *TextWidget) Redraw(data func() (string, string, bool)) {
// FIXME: This is coming from KeyboardWidget, which seems wrong
widget.tviewApp.QueueUpdateDraw(func() {
title, content, wrap := data()