ListView change item count – Fyne Golang GUI Tutorial
How to change item count in Fyne ListView?
Source Code
package main // import fyne import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/app" "fyne.io/fyne/v2/widget" ) func main() { a := app.New() // window and title w := a.NewWindow("List View") // resize w.Resize(fyne.NewSize(400, 400)) list := widget.NewList( // lets change item count 5 func() int { return 5 }, // my list contain 5 items func() fyne.CanvasObject { return widget.NewLabel("I want to use label") }, // last one func(lii widget.ListItemID, co fyne.CanvasObject) { // update data of widget co.(*widget.Label).SetText("Here is my text") }, ) // setup data on screen w.SetContent(list) w.ShowAndRun() }