How can I automatically render list items when they go into frame? #4748
-
I have created a list of todo items like so: todoList := widget.NewList(
func() int {
return len(todos)
},
func() fyne.CanvasObject {
return widget.NewCheck("template", func(checked bool) {})
},
func(lii widget.ListItemID, co fyne.CanvasObject) {
check := co.(*widget.Check)
check.Text = todos[lii].Text
check.Checked = todos[lii].Completed
},
) And then I set the content of the window content := container.NewPadded(todoList)
w.SetContent(content) But, all the todo items are like this
Until I hover over them with my mouse (or tap them when in the mobile simulation). |
Beta Was this translation helpful? Give feedback.
Answered by
andydotxyz
Mar 27, 2024
Replies: 1 comment 2 replies
-
you are forgetting to call |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Agent-E11
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you are forgetting to call
check.Refresh()
after you manipulate the state.