From 27bd47f015335e95a4fd3a15f53a12a4c6d9b849 Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Tue, 2 Jun 2020 17:24:36 -0300 Subject: [PATCH] Brain segmentation was not working --- invesalius/gui/widgets/gradient.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/invesalius/gui/widgets/gradient.py b/invesalius/gui/widgets/gradient.py index df7e609..dd71324 100644 --- a/invesalius/gui/widgets/gradient.py +++ b/invesalius/gui/widgets/gradient.py @@ -26,12 +26,15 @@ from wx.lib import intctrl from invesalius.gui.widgets.inv_spinctrl import InvSpinCtrl -dc = wx.MemoryDC() -font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) -dc.SetFont(font) -PUSH_WIDTH = dc.GetTextExtent("M")[0] // 2 + 1 -del dc -del font +try: + dc = wx.MemoryDC() + font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) + dc.SetFont(font) + PUSH_WIDTH = dc.GetTextExtent("M")[0] // 2 + 1 + del dc + del font +except Exception: + PUSH_WIDTH = 7 myEVT_SLIDER_CHANGED = wx.NewEventType() EVT_SLIDER_CHANGED = wx.PyEventBinder(myEVT_SLIDER_CHANGED, 1) -- libgit2 0.21.2