mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Remove the app.Draw() gorountine
Prefer to have widgets force a draw when their data changes. This should reduce draws (unless the user has a module installed that updates >= 1/sec, the old draw default). This should also remove a source of some of the race conditions that users were experiencing (though not all, there are still many).
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
"github.com/senorprogrammer/wtf/wtf"
|
||||
)
|
||||
|
||||
@@ -15,9 +16,9 @@ type Widget struct {
|
||||
Version string
|
||||
}
|
||||
|
||||
func NewWidget(date, version string) *Widget {
|
||||
func NewWidget(app *tview.Application, date, version string) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget("System", "system", false),
|
||||
TextWidget: wtf.NewTextWidget(app, "System", "system", false),
|
||||
|
||||
Date: date,
|
||||
Version: version,
|
||||
|
||||
Reference in New Issue
Block a user