From be259860dade558d41c76a68240cff55d5091337 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Tue, 2 Feb 2021 11:31:21 -0500 Subject: [PATCH] Convert Combo values into a list in case the user passed something that wasn't a list --- PySimpleGUI.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index f06ebb9c..8e935ae2 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,5 +1,5 @@ #!/usr/bin/python3 -version = __version__ = "4.34.0.11 Unreleased\nSDK Help Expanded to init & update parms, SDK Help function search, files_delimiter added to FilesBrowse & popup_get_file, SDK help sort by case, popup_get_file fixed default_extension not being passed to button correctly, changed themes so that spaces can be used in defined name, addition of subprocess non-blocking launcher, fix for Debug button color, set_option for default user_settings path to override normal default, define a truly global PySimpleGUI settings path, theme_global() gets the theme for all progams, execute_subprocess_nonblocking bug fix, mark when strout/stderr is restored in multiline elem" +version = __version__ = "4.34.0.12 Unreleased\nSDK Help Expanded to init & update parms, SDK Help function search, files_delimiter added to FilesBrowse & popup_get_file, SDK help sort by case, popup_get_file fixed default_extension not being passed to button correctly, changed themes so that spaces can be used in defined name, addition of subprocess non-blocking launcher, fix for Debug button color, set_option for default user_settings path to override normal default, define a truly global PySimpleGUI settings path, theme_global() gets the theme for all progams, execute_subprocess_nonblocking bug fix, mark when strout/stderr is restored in multiline elem, Listbox element convert values to list when updated" __version__ = version.split()[0] # For PEP 396 and PEP 345 @@ -1841,10 +1841,10 @@ class Listbox(Element): self.TKListbox.configure(state='normal') if values is not None: self.TKListbox.delete(0, 'end') - for item in values: + for item in list(values): self.TKListbox.insert(tk.END, item) # self.TKListbox.selection_set(0, 0) - self.Values = values + self.Values = list(values) if set_to_index is not None: self.TKListbox.selection_clear(0, len(self.Values)) # clear all listbox selections if type(set_to_index) in (tuple, list): @@ -11336,7 +11336,7 @@ def _BuildResultsForSubform(form, initialize_only, top_level_form): try: items = element.TKListbox.curselection() value = [element.Values[int(item)] for item in items] - except: + except Exception as e: value = '' elif element.Type == ELEM_TYPE_INPUT_SPIN: try: @@ -18784,6 +18784,4 @@ if __name__ == '__main__': main_sdk_help() exit(0) main() - exit(0) - - + exit(0) \ No newline at end of file