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.
21 lines
318 B
Go
21 lines
318 B
Go
package cointop
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/miguelmota/gocui"
|
|
)
|
|
|
|
// Update takes a callback which updates the view
|
|
func (ct *Cointop) Update(f func() error) {
|
|
ct.debuglog(fmt.Sprintf("Update()"))
|
|
|
|
if ct.g == nil {
|
|
panic("gocui is not initialized")
|
|
}
|
|
|
|
ct.g.Update(func(g *gocui.Gui) error {
|
|
return f()
|
|
})
|
|
}
|