diff options
Diffstat (limited to 'widgets/spinner.go')
-rw-r--r-- | widgets/spinner.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/widgets/spinner.go b/widgets/spinner.go index 0ab3e138..bb7dbe8d 100644 --- a/widgets/spinner.go +++ b/widgets/spinner.go @@ -23,8 +23,8 @@ var ( ) type Spinner struct { + ui.Invalidatable frame int64 // access via atomic - onInvalidate func(d ui.Drawable) stop chan struct{} } @@ -84,12 +84,6 @@ func (s *Spinner) Draw(ctx *ui.Context) { ctx.Printf(col, 0, tcell.StyleDefault, "%s", frames[cur]) } -func (s *Spinner) OnInvalidate(onInvalidate func(d ui.Drawable)) { - s.onInvalidate = onInvalidate -} - func (s *Spinner) Invalidate() { - if s.onInvalidate != nil { - s.onInvalidate(s) - } + s.DoInvalidate(s) } |