From: Robin Dunn Date: Mon, 29 Dec 2003 19:25:47 +0000 (+0000) Subject: Fixed drawing of the lines data, also ensure that only tuples are X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0dfb2393ddd200cb698351dbd44590898590d8c1 Fixed drawing of the lines data, also ensure that only tuples are pickled since there is currently a problem with unpickling wx.Points... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25030 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/demo/CustomDragAndDrop.py b/wxPython/demo/CustomDragAndDrop.py index fcb0947287..13a78426bb 100644 --- a/wxPython/demo/CustomDragAndDrop.py +++ b/wxPython/demo/CustomDragAndDrop.py @@ -46,7 +46,7 @@ class DoodlePad(wx.Window): dc.SetPen(wx.Pen(wx.BLUE, 3)) for line in self.lines: for coords in line: - dc.DrawLineXY(*coords) + dc.DrawLine(*coords) dc.EndDrawing() @@ -76,9 +76,9 @@ class DoodlePad(wx.Window): dc = wx.ClientDC(self) dc.BeginDrawing() dc.SetPen(wx.Pen(wx.BLUE, 3)) - coords = ((self.x, self.y), event.GetPosition()) + coords = ((self.x, self.y), event.GetPositionTuple()) self.curLine.append(coords) - dc.DrawLineXY(*coords) + dc.DrawLine(*coords) self.x, self.y = event.GetPositionTuple() dc.EndDrawing() @@ -171,7 +171,7 @@ class DoodleDropTarget(wx.PyDropTarget): if self.GetData(): # convert it back to a list of lines and give it to the viewer linesdata = self.data.GetData() - lines = wx.InputStream(cPickle.loads(linesdata)) + lines = cPickle.loads(linesdata) self.dv.SetLines(lines) # what is returned signals the source what to do @@ -207,7 +207,7 @@ class DoodleViewer(wx.Window): for line in self.lines: for coords in line: - dc.DrawLineXY(*coords) + dc.DrawLine(*coords) dc.EndDrawing() #----------------------------------------------------------------------