]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed drawing of the lines data, also ensure that only tuples are
authorRobin Dunn <robin@alldunn.com>
Mon, 29 Dec 2003 19:25:47 +0000 (19:25 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 29 Dec 2003 19:25:47 +0000 (19:25 +0000)
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

wxPython/demo/CustomDragAndDrop.py

index fcb094728724782ccd01e427bb921dc4f73abf45..13a78426bbc16b1eaa69de2d303e7d86411f15d7 100644 (file)
@@ -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()
 
 #----------------------------------------------------------------------