-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I created a simple class that extends from ImageViewer and when I update this loading a new Image, the widget is not redrawn.
class ImageWidget(ImageViewer):
def __init__(self, image: Image.Image | None, id=None):
if image is None:
image = Image.new('L', (2295, 4540), 0)
super().__init__(image)
self.id = id
def update(self, image: Image.Image):
self.image = ImageView(image)
self.refresh()
The solution that I found is to set the container coordinates and use on_show() instead of refresh():
class ImageWidget(ImageViewer):
def __init__(self, image: Image.Image | None, id=None):
if image is None:
image = Image.new('L', (2295, 4540), 0)
super().__init__(image)
self.id = id
def update(self, image: Image.Image):
self.image = ImageView(image)
self.image.set_container_size(*self.container_size)
self.on_show()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels