From 984adae62cb3c395a7a1638707bc04d5f73e64f2 Mon Sep 17 00:00:00 2001 From: daid Date: Mon, 24 Feb 2014 10:56:44 +0100 Subject: [PATCH] Fix for if Cocoa library is not found. --- Cura/gui/mainWindow.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index 6d23ba9b..66ed2b37 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -35,11 +35,13 @@ class mainWindow(wx.Frame): # TODO: wxWidgets 2.9.4 has a bug when NSView does not register for dragged types when wx drop target is set. It was fixed in 2.9.5 if sys.platform.startswith('darwin'): - import Cocoa - import objc - nswindow = objc.objc_object(c_void_p=self.MacGetTopLevelWindowRef()) - view = nswindow.contentView() - view.registerForDraggedTypes_([Cocoa.NSFilenamesPboardType]) + try: + import objc + nswindow = objc.objc_object(c_void_p=self.MacGetTopLevelWindowRef()) + view = nswindow.contentView() + view.registerForDraggedTypes_([u'NSFilenamesPboardType']) + except: + pass self.normalModeOnlyItems = [] -- 2.30.2