mirror of https://github.com/miguelmota/cointop
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
320 B
Go
20 lines
320 B
Go
package cointop
|
|
|
|
import (
|
|
"github.com/cointop-sh/cointop/pkg/gocui"
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// UpdateUI takes a callback which updates the view
|
|
func (ct *Cointop) UpdateUI(f func() error) {
|
|
log.Debug("UpdateUI()")
|
|
|
|
if ct.g == nil {
|
|
return
|
|
}
|
|
|
|
ct.g.Update(func(g *gocui.Gui) error {
|
|
return f()
|
|
})
|
|
}
|