boltbrowser/ui/ui.go
2022-04-20 16:22:43 -05:00

32 lines
594 B
Go

package ui
import (
"git.bullercodeworks.com/brian/wandle"
"github.com/nsf/termbox-go"
)
const (
BrowseId = iota << 5
AboutId
)
type Ui struct {
wandle *wandle.Program
browseScreen *browseScreen
}
func NewUi() *Ui {
u := new(Ui)
u.browseScreen = NewBrowseScreen(u)
u.wandle = wandle.NewProgram(u.browseScreen)
//u.wandle = wandle.NewProgram(NewAboutScreen(u))
u.wandle.Style(wandle.NewStyle(
termbox.RGBToAttribute(uint8(0), uint8(255), uint8(0)),
termbox.RGBToAttribute(uint8(0), uint8(0), uint8(0)),
))
return u
}
func (u *Ui) Start() error { return u.wandle.Start() }