From 7499d3f989681f236e83aa8c82d8e7f308708053 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Fri, 28 Jun 2019 16:56:25 -0400 Subject: [PATCH] Fix for crash when opening window twice with ComboBoxes --- PySimpleGUI.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index fb34ac83..d50534c9 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -7130,7 +7130,11 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): # print(unique_field) # Clones over the TCombobox.field element from the "alt" theme. # This is what will allow us to change the background color without altering the whole programs theme - combostyle.element_create(unique_field, "from", "alt") + + try: # if this element is in a window that's shown TWICE, will get an error here, so skip error + combostyle.element_create(unique_field, "from", "alt") + except: + pass # Create widget layout using cloned "alt" field combostyle.layout(style_name, [