From 3f0357e348b60f2e00ea4a8350c9acda9bb7d46d Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Thu, 15 Jul 2021 14:39:59 -0300 Subject: [PATCH] InVesalius main windows was being hiden when using region growing in 3D --- invesalius/data/styles.py | 9 ++++----- invesalius/gui/dialogs.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/invesalius/data/styles.py b/invesalius/data/styles.py index a2b8b60..16360a4 100644 --- a/invesalius/data/styles.py +++ b/invesalius/data/styles.py @@ -1459,7 +1459,7 @@ class WatershedProgressWindow(object): self.dlg = wx.ProgressDialog(self.title, self.msg, - parent = None, + parent = wx.GetApp().GetTopWindow(), style = self.style) self.dlg.Bind(wx.EVT_BUTTON, self.Cancel) @@ -2349,7 +2349,7 @@ class FloodFillMaskInteractorStyle(DefaultInteractorStyle): with futures.ThreadPoolExecutor(max_workers=1) as executor: future = executor.submit(floodfill.floodfill_threshold, mask, [[x, y, z]], self.t0, self.t1, self.fill_value, bstruct, mask) - dlg = wx.ProgressDialog(self._progr_title, self._progr_msg, parent=None, style=wx.PD_APP_MODAL) + dlg = wx.ProgressDialog(self._progr_title, self._progr_msg, parent=wx.GetApp().GetTopWindow(), style=wx.PD_APP_MODAL) while not future.done(): dlg.Pulse() time.sleep(0.1) @@ -2787,7 +2787,7 @@ class FloodFillSegmentInteractorStyle(DefaultInteractorStyle): with futures.ThreadPoolExecutor(max_workers=1) as executor: future = executor.submit(self.do_rg_confidence, image, mask, (x, y, z), bstruct) - dlg = wx.ProgressDialog(self._progr_title, self._progr_msg, parent=None, style=wx.PD_APP_MODAL) + dlg = wx.ProgressDialog(self._progr_title, self._progr_msg, parent=wx.GetApp().GetTopWindow(), style=wx.PD_APP_MODAL|wx.PD_AUTO_HIDE) while not future.done(): dlg.Pulse() time.sleep(0.1) @@ -2798,11 +2798,10 @@ class FloodFillSegmentInteractorStyle(DefaultInteractorStyle): with futures.ThreadPoolExecutor(max_workers=1) as executor: future = executor.submit(floodfill.floodfill_threshold, image, [[x, y, z]], t0, t1, 1, bstruct, out_mask) - dlg = wx.ProgressDialog(self._progr_title, self._progr_msg, parent=None, style=wx.PD_APP_MODAL) + dlg = wx.ProgressDialog(self._progr_title, self._progr_msg, parent=wx.GetApp().GetTopWindow(), style=wx.PD_APP_MODAL|wx.PD_AUTO_HIDE) while not future.done(): dlg.Pulse() time.sleep(0.1) - dlg.Destroy() mask[out_mask.astype('bool')] = self.config.fill_value diff --git a/invesalius/gui/dialogs.py b/invesalius/gui/dialogs.py index 1e2932a..afb0c25 100644 --- a/invesalius/gui/dialogs.py +++ b/invesalius/gui/dialogs.py @@ -2745,7 +2745,7 @@ class SelectPartsOptionsDialog(wx.Dialog): self.Destroy() class FFillSegmentationOptionsDialog(wx.Dialog): - def __init__(self, config, ID=-1, title=_(u"Region growing"), style=wx.DEFAULT_DIALOG_STYLE|wx.FRAME_FLOAT_ON_PARENT|wx.STAY_ON_TOP): + def __init__(self, config, ID=-1, title=_(u"Region growing"), style=wx.DEFAULT_DIALOG_STYLE|wx.FRAME_FLOAT_ON_PARENT): wx.Dialog.__init__(self, wx.GetApp().GetTopWindow(), ID, title=title, style=style) self.config = config -- libgit2 0.21.2