copy from fyne-io/fyne/v2 v2.1.4 https://github.com/fyne-io/fyne
t := widget.NewTable(
func() (int, int) { return 500, 150 },
func() fyne.CanvasObject {
return widget.NewLabel("Cell 000, 000")
},
func(id widget.TableCellID, cell fyne.CanvasObject) {
label := cell.(*widget.Label)
switch id.Col {
case 0:
label.SetText(fmt.Sprintf("%d", id.Row+1))
case 1:
label.SetText("A longer cell")
default:
label.SetText(fmt.Sprintf("Cell %d, %d", id.Row+1, id.Col+1))
}
})
t.FullRowSelect =true