From 9a2bc8bf8ce3a2f6582ee947d6d34cc4426995e8 Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Thu, 18 Aug 2016 13:41:21 -0300 Subject: [PATCH] Closing the ffill dialog when getting out the ffill interaction style --- invesalius/data/styles.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/invesalius/data/styles.py b/invesalius/data/styles.py index 288aa24..cad8b16 100644 --- a/invesalius/data/styles.py +++ b/invesalius/data/styles.py @@ -1761,7 +1761,6 @@ class FFillConfig(object): class FloodFillMaskInteractorStyle(DefaultInteractorStyle): - dialog = None def __init__(self, viewer): DefaultInteractorStyle.__init__(self, viewer) @@ -1773,13 +1772,20 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): self.slice_data = viewer.slice_data self.config = FFillConfig() + self.dlg_ffill = None + self.AddObserver("LeftButtonPressEvent", self.OnFFClick) + + def SetUp(self): if not self.config.dlg_visible: self.config.dlg_visible = True - dlg_ffill = dialogs.FFillOptionsDialog(self.config) - dlg_ffill.Show() + self.dlg_ffill = dialogs.FFillOptionsDialog(self.config) + self.dlg_ffill.Show() - self.AddObserver("LeftButtonPressEvent", self.OnFFClick) + def CleanUp(self): + self.config.dlg_visible = False + if self.dlg_ffill is not None: + self.dlg_ffill.Destroy() def OnFFClick(self, obj, evt): if (self.viewer.slice_.buffer_slices[self.orientation].mask is None): -- libgit2 0.21.2