boltbrowser/ui/ui.go

32 lines
594 B
Go
Raw Normal View History

2022-04-14 16:32:39 +00:00
package ui
import (
"git.bullercodeworks.com/brian/wandle"
2022-04-20 21:22:43 +00:00
"github.com/nsf/termbox-go"
2022-04-14 16:32:39 +00:00
)
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)
2022-04-20 21:22:43 +00:00
//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)),
))
2022-04-14 16:32:39 +00:00
return u
}
func (u *Ui) Start() error { return u.wandle.Start() }