I created a custom widget in Fyne that dynamically adds other widgets.
Everything works fine — until I hide the parent widget and show it again after a few minutes.
When I call .Show() again, all the dynamically added child widgets disappear.
If I show it quickly (before ~2 minutes), it works fine.
It looks like the children are removed or cleaned up after the FYNE_CACHE timeout.
Here’s a simplified example:
func (a *A) CreateRenderer() fyne.WidgetRenderer {
a.body = container.NewVBox()
return widget.NewSimpleRenderer(a.body)
}
func (b *B) AddItem(item fyne.CanvasObject) {
b.body.Add(item)
}
Why do the dynamically added items disappear after hiding/unhiding the widget? How can I make them persist across cache rebuilds?