Closed csgoh closed 1 year ago
That seems strange.
Can you try output_img.update()
?
If it still doesn't work, then build up some small working code sample with the issue, so we/I can give it a better look.
Same result even if I use output_img.update()
If it still doesn't work, then build up some small working code sample with the issue, so we/I can give it a better look.
@ndonkoHenri, I have provided a complete code sample that reproduce the issue. See the original post above. Thanks!
@csgoh by changing image file contents you are not changing Flet control properties. output_image.src
and other image properties stay the same as a result page.update()
does nothing.
Solution: every time you generate new image change its filename too.
My application requires to generate images on the fly and the output is display on a Image Control. However, everytime my image is generated, calling Image.src = does not refresh the image. The Image control is still showing the first image.
Code example to reproduce the issue:
The render() method regenerates the image based on the diagram_text. However, the
output_image.src
has no effect when called subsequent times.To reproduce the bug,
pip install processpiper
Generate
button to get the first diagram generated and displayed on the screen.test_text
by replacingdone_baking-"Yes"->take_pizza_out_of_oven->end
todone_baking-"Yippie!"->take_pizza_out_of_oven->end
Generate
button again to regenerate the diagram.diagram.png
file on the folder, it shows the correct image, but the app is still showing the previous image.I expect the output_image get updated and showing the latest image.
Additional information you deem important (e.g. issue happens only occasionally):
Flet version (
pip show flet
):Operating system: Windows
Additional environment details: