When i set the background color after creating a grid, the entire terminal gets the color and i can't see the grid anymore.
package main
import (
"github.com/rivo/tview"
"github.com/gdamore/tcell"
)
func main() {
newPrimitive := func(text string) tview.Primitive {
return tview.NewTextView().
SetTextAlign(tview.AlignCenter).
SetText(text)
}
songList := newPrimitive("songs")
songInfo := newPrimitive("info")
grid := tview.NewGrid().
SetRows(-1, 5).
SetColumns(0).
SetBorders(true).
AddItem(songList, 0, 0, 1, 1, 0, 0, false).
AddItem(songInfo, 1, 0, 1, 1, 0, 0, false).
SetBackgroundColor(tcell.ColorDefault)
if err := tview.NewApplication().SetRoot(grid, true).SetFocus(grid).Run(); err != nil {
panic(err)
}
}
Seizing the opportunity. I'm learning programming right now and i started with Go and tview. I made a function that lists all the songs in a folder, prints and play the songs in sequence. How do i execute this function inside the songList primitive in this grid? I want the song list printed there.
When i set the background color after creating a grid, the entire terminal gets the color and i can't see the grid anymore.
Seizing the opportunity. I'm learning programming right now and i started with Go and tview. I made a function that lists all the songs in a folder, prints and play the songs in sequence. How do i execute this function inside the songList primitive in this grid? I want the song list printed there.
Thanks!