Files
esdi/tui/internal/views/outputWin.go
T
esilva e64b1c31b9 chanding the architecure, removing the views ability to emit or listen to events
I liked my idea better but I recon I will hit less obstacles this way
2026-02-24 23:22:19 +00:00

33 lines
581 B
Go

package views
import (
"github.com/rivo/tview"
)
// func bindOutputWindowEvents(
// bus *events.Bus,
// output *tview.TextView,
// ) {
// bus.On(ui.PrintLogEv{}, func(e any) {
// le, _ := e.(ui.PrintLogEv)
// fmt.Fprintf(output, le.Log)
// })
// }
type OutputWinView struct {
TextArea *tview.TextView
}
func NewOutputWinView() *OutputWinView {
var outputWin *tview.TextView
outputWin = tview.NewTextView().SetChangedFunc(func() {
outputWin.ScrollToEnd()
})
outputWin.SetBorder(true).SetTitle("DebugWindow")
return &OutputWinView{
TextArea: outputWin,
}
}