From 2e0cd692d16b4cab632723d1ab9c01af959292a2 Mon Sep 17 00:00:00 2001 From: sagar-sehgal Date: Wed, 19 Dec 2018 22:55:54 +0530 Subject: [PATCH] closing the old cell window --- gui/grid_mdp.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gui/grid_mdp.py b/gui/grid_mdp.py index d975ba5df..540bc2611 100644 --- a/gui/grid_mdp.py +++ b/gui/grid_mdp.py @@ -41,6 +41,7 @@ green8 = '#008080' green4 = '#004040' +cell_window_mantainer=None def extents(f): ''' adjusts axis markers for heatmap ''' @@ -251,7 +252,12 @@ def initialize_widget_disability_checks(_width, _height, gridmdp, terminals, lab def dialogbox(i, j, gridmdp, terminals, buttons, _height): ''' creates dialogbox for each cell ''' + global cell_window_mantainer + if(cell_window_mantainer!=None): + cell_window_mantainer.destroy() + dialog = tk.Toplevel() + cell_window_mantainer=dialog dialog.wm_title(f'{_height - i - 1}, {j}') container = tk.Frame(dialog)