diff --git a/flatland/utils/graphics_pil.py b/flatland/utils/graphics_pil.py index 45733defbf19227ed90bfafb5cee0abf90e36c4e..ffa3324376ebaa49a9c947f10881627809f53f11 100644 --- a/flatland/utils/graphics_pil.py +++ b/flatland/utils/graphics_pil.py @@ -131,7 +131,9 @@ class PILGL(GraphicsLayer): assert self.window_open is False, "Window is already open!" # use tk.Toplevel() instead of tk.Tk() # https://stackoverflow.com/questions/26097811/image-pyimage2-doesnt-exist - self.window = tk.Toplevel() + root = tk.Tk() + root.withdraw() + self.window = tk.Toplevel(root) self.window.title("Flatland") self.window.configure(background='grey') self.window_open = True