package ui import ( "strings" "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() } // A few Helper Functions func pathToString(p []string) string { return strings.Join(p, " → ") } func comparePaths(p1, p2 []string) bool { return pathToString(p1) == pathToString(p2) }