From 2f7aeff121f95c4ab870e0a7d0cb10800c2bb931 Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Wed, 9 Apr 2014 15:31:49 -0300 Subject: [PATCH] When there isn't a mask the task slice is disabled --- invesalius/gui/task_slice.py | 7 +++++++ 1 file changed, 7 insertions(+), 0 deletions(-) diff --git a/invesalius/gui/task_slice.py b/invesalius/gui/task_slice.py index 282a69f..ea81462 100644 --- a/invesalius/gui/task_slice.py +++ b/invesalius/gui/task_slice.py @@ -399,6 +399,11 @@ class MaskProperties(wx.Panel): for i in list_index: self.combo_mask_name.Delete(i) + if self.combo_mask_name.IsEmpty(): + self.combo_mask_name.SetValue('') + self.Disable() + + def __bind_events_wx(self): self.Bind(grad.EVT_THRESHOLD_CHANGED, self.OnSlideChanged, self.gradient) self.Bind(grad.EVT_THRESHOLD_CHANGING, self.OnSlideChanging, self.gradient) @@ -454,6 +459,8 @@ class MaskProperties(wx.Panel): self.button_colour.SetColour(colour) def AddMask(self, evt_pubsub): + if self.combo_mask_name.IsEmpty(): + self.Enable() mask_name = evt_pubsub.data[1] mask_thresh = evt_pubsub.data[2] mask_colour = [int(c*255) for c in evt_pubsub.data[3]] -- libgit2 0.21.2