Merge pull request #645 from AltoRetrato/patch-1
Allow Image update to set size
This commit is contained in:
commit
32bd271c69
|
@ -1518,7 +1518,7 @@ class Image(Element):
|
|||
tooltip=tooltip)
|
||||
return
|
||||
|
||||
def Update(self, filename=None, data=None):
|
||||
def Update(self, filename=None, data=None, size=(None,None)):
|
||||
if filename is not None:
|
||||
image = tk.PhotoImage(file=filename)
|
||||
elif data is not None:
|
||||
|
@ -1531,9 +1531,8 @@ class Image(Element):
|
|||
# image = data
|
||||
else:
|
||||
return
|
||||
width, height = image.width(), image.height()
|
||||
width, height = size[0] or image.width(), size[1] or image.height()
|
||||
self.tktext_label.configure(image=image, width=width, height=height)
|
||||
# self.tktext_label.configure(image=image)
|
||||
self.tktext_label.image = image
|
||||
|
||||
def __del__(self):
|
||||
|
|
Loading…
Reference in New Issue