From e16401abc45b7d1e959e996775a06c6a3fd5a673 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 5 Mar 2020 09:52:24 -0800 Subject: [PATCH] Use UTI strings for custom data format names. It seems to be required on macOS now. --- demo/CustomDragAndDrop.py | 6 ++---- unittests/test_dataobj.py | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/demo/CustomDragAndDrop.py b/demo/CustomDragAndDrop.py index 3cbdef76..0722025f 100644 --- a/demo/CustomDragAndDrop.py +++ b/demo/CustomDragAndDrop.py @@ -76,7 +76,7 @@ class DoodlePad(wx.Window): # create our own data format and use it in a # custom data object - ldata = wx.CustomDataObject("DoodleLines") + ldata = wx.CustomDataObject("application.DoodleLines") ldata.SetData(linesdata) # Also create a Bitmap version of the drawing @@ -119,7 +119,7 @@ class DoodleDropTarget(wx.DropTarget): self.dv = window # specify the type of data we will accept - self.data = wx.CustomDataObject("DoodleLines") + self.data = wx.CustomDataObject("application.DoodleLines") self.SetDataObject(self.data) @@ -200,8 +200,6 @@ class CustomDnDPanel(wx.Panel): def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) - self.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) - # Make the controls text1 = wx.StaticText(self, -1, "Draw a little picture in this window\n" diff --git a/unittests/test_dataobj.py b/unittests/test_dataobj.py index a878e45e..6dcdc950 100644 --- a/unittests/test_dataobj.py +++ b/unittests/test_dataobj.py @@ -121,7 +121,7 @@ class DataObjTests(wtc.WidgetTestCase): class MyDataObject(wx.DataObject): def __init__(self, value=''): wx.DataObject.__init__(self) - self.myFormats = [wx.DataFormat("My Custom DataFormat")] + self.myFormats = [wx.DataFormat("application.MyCustomDataFormat")] self.myData = wtc.mybytes(value) def GetAllFormats(self, d): @@ -216,7 +216,7 @@ class DataObjTests(wtc.WidgetTestCase): class MyDataObject(wx.DataObjectSimple): def __init__(self, value=''): wx.DataObjectSimple.__init__(self) - self.SetFormat(wx.DataFormat("My Custom Data Format")) + self.SetFormat(wx.DataFormat("application.MyCustomDataFormat")) self.myData = wtc.mybytes(value) def GetDataSize(self):