func (ui *UI) Loop() {
	if err := ui.gui.MainLoop(); err != nil && err != gocui.ErrQuit {
		log.Panicln(err)
	}
}
Loop starts the GUI loop.
package ui
import (
	"log"
	"sync"
	"time"
	"github.com/jroimartin/gocui"
)
type UI struct {
	gui          *gocui.Gui
	currentView  int
	nextItem     int
	currentModal string
	consoleLog   string
	cursors      Cursors
	modalTimer   *time.Timer
	logTimer     *time.Timer
	mutex        *sync.Mutex
	fontPath     string
}
func NewUI(fontPath string) *UI {
	var err error
	ui := new(UI)
	ui.gui, err = gocui.NewGui(gocui.Output256)
	if err != nil {
		log.Panicln(err)
	}
	ui.cursors = NewCursors()
	ui.fontPath = fontPath
	return ui
}
func (ui *UI) Init() {
	if err := ui.initGui(ui.gui); err != nil {
		log.Panicln(err)
	}
}
type Cursors map[string]struct{ x, y int }
func NewCursors() Cursors {
	return make(Cursors)
}
func (c Cursors) Restore(view *gocui.View) error {
	return view.SetCursor(c.Get(view.Name()))
}
func (c Cursors) Get(view string) (int, int) {
	if v, ok := c[view]; ok {
		return v.x, v.y
	}
	return 0, 0
}
func (c Cursors) Set(view string, x, y int) {
	c[view] = struct{ x, y int }{x, y}
}