Skip to content
Snippets Groups Projects
Commit 39de57c1 authored by Egli Adrian (IT-SCI-API-PFI)'s avatar Egli Adrian (IT-SCI-API-PFI)
Browse files

Bug fiex: root = tk.TK() must be destroyied as well

parent 6f098694
No related branches found
No related tags found
No related merge requests found
...@@ -75,6 +75,7 @@ class PILGL(GraphicsLayer): ...@@ -75,6 +75,7 @@ class PILGL(GraphicsLayer):
self.ltAgentColors = [self.rgb_s2i(sColor) for sColor in sColors.split("#")] self.ltAgentColors = [self.rgb_s2i(sColor) for sColor in sColors.split("#")]
self.nAgentColors = len(self.ltAgentColors) self.nAgentColors = len(self.ltAgentColors)
self.window_root = None
self.window_open = False self.window_open = False
self.firstFrame = True self.firstFrame = True
self.create_layers() self.create_layers()
...@@ -131,9 +132,9 @@ class PILGL(GraphicsLayer): ...@@ -131,9 +132,9 @@ class PILGL(GraphicsLayer):
assert self.window_open is False, "Window is already open!" assert self.window_open is False, "Window is already open!"
# use tk.Toplevel() instead of tk.Tk() # use tk.Toplevel() instead of tk.Tk()
# https://stackoverflow.com/questions/26097811/image-pyimage2-doesnt-exist # https://stackoverflow.com/questions/26097811/image-pyimage2-doesnt-exist
root = tk.Tk() self.window_root = tk.Tk()
root.withdraw() self.window_root.withdraw()
self.window = tk.Toplevel(root) self.window = tk.Toplevel(self.window_root)
self.window.title("Flatland") self.window.title("Flatland")
self.window.configure(background='grey') self.window.configure(background='grey')
self.window_open = True self.window_open = True
...@@ -142,6 +143,8 @@ class PILGL(GraphicsLayer): ...@@ -142,6 +143,8 @@ class PILGL(GraphicsLayer):
self.panel.destroy() self.panel.destroy()
self.window.quit() self.window.quit()
self.window.destroy() self.window.destroy()
self.window_root.destroy()
self.window = None
def text(self, *args, **kwargs): def text(self, *args, **kwargs):
pass pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment