-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Window becomes unresponsive on resize #1189
Comments
You should not make pointers to, then dereference, the Window by the way. Your function would be better as: |
I'll look into this next time I am on a Windows computer, but in the meantime I would recommend not re-building your layout every time. Instead consider using |
As some additional information, this reproduces on a separate Windows device, though it's another local device so unsurprisingly my environment is virtually identical. I'm trying to access a different device to see if I can continue to reproduce. The same issue reproduces if I use AddObject as well, the modified sample I ran is below. package main
import (
"strconv"
"fyne.io/fyne/app"
"fyne.io/fyne/layout"
"fyne.io/fyne/widget"
"fyne.io/fyne"
)
func main() {
fyneApp := app.New()
configWindow := fyneApp.NewWindow("Example - Problems")
containerContents(configWindow)
configWindow.ShowAndRun()
}
var (
hackyGlobalExample []int // Please don't judge me...
)
func containerContents(window fyne.Window) {
items := []fyne.CanvasObject{}
for i := range hackyGlobalExample {
items = append(items, widget.NewLabel(strconv.Itoa(i)))
}
configContainer := fyne.NewContainerWithLayout(layout.NewGridLayout(1),
items...,
)
addButton := widget.NewButton("Add", func() {
hackyGlobalExample = append(hackyGlobalExample, len(hackyGlobalExample))
configContainer.AddObject(widget.NewLabel(strconv.Itoa(len(hackyGlobalExample))))
})
configContainer.AddObject(addButton)
window.SetContent(configContainer)
} |
OK, I can replicate this on Windows. Fix should be easier now :) |
Internal content expanding triggered this on Windows Fixes #1189
This should now be fixed on |
Describe the bug:
When updating the window contents, the application resizes the active window, but fails to display the new content and becomes unresponsive. This reproduces with a relatively small piece of code, but it's not unlikely that I'm simply doing something incorrectly. My application isn't particularly robust yet.
To Reproduce:
Steps to reproduce the behaviour:
Screenshots:
Before:
After:
Example code:
Device (please complete the following information):
The text was updated successfully, but these errors were encountered: