Open
Description
What is the problem or limitation you are having?
I currently don't know when the window is getting resized, so I can't make adaptive decisions about how the content is being displayed unless I keep a background task continually "manually" checking. Example:
async def update_background_image(self, app, **kwargs):
while True:
if self.main_window.size[0] != self.background_image.width:
new_image_size = (self.main_window.size[0], self.background_image.height)
scaled_image = self.background_image.resize(new_image_size)
self.background_image_view.image = scaled_image
await asyncio.sleep(1)
Describe the solution you'd like
An on_change
method in MainWindow.
This way, I can specify a function to be called only when the window has changed.
Describe alternatives you've considered
- Keep doing it manually;
- For the exemplified use case, it would be better if I was able to tell the image to adopt the window's width (or its box's width), so I wouldn't have to do any resizing.
Additional context
No response