Merge pull request #2503 from PySimpleGUI/Dev-latest

Fix for Multiline update with no value parameter specified
This commit is contained in:
PySimpleGUI 2020-01-13 16:10:49 -05:00 committed by GitHub
commit 09287afefe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "4.15.1.1 Unreleased - Fix for draw_pixel" version = __version__ = "4.15.1.2 Unreleased - Fix for draw_pixel, fix Multline.update with no value specified"
port = 'PySimpleGUI' port = 'PySimpleGUI'
@ -1817,7 +1817,6 @@ class Multiline(Element):
:param visible: (bool) set visibility state of the element :param visible: (bool) set visibility state of the element
:param autoscroll: (bool) if True then contents of element are scrolled down when new text is added to the end :param autoscroll: (bool) if True then contents of element are scrolled down when new text is added to the end
""" """
value = str(value)
if self.Widget is None: if self.Widget is None:
warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning) warnings.warn('You cannot Update element with key = {} until the window has been Read or Finalized'.format(self.Key), UserWarning)
return return
@ -1830,6 +1829,7 @@ class Multiline(Element):
self.TKText.tag_configure(str(self.TagCounter), background=background_color_for_value) self.TKText.tag_configure(str(self.TagCounter), background=background_color_for_value)
if value is not None: if value is not None:
value = str(value)
if self.Disabled: if self.Disabled:
self.TKText.configure(state='normal') self.TKText.configure(state='normal')
try: try: