[wxPython-dev] weird error in 2.7
Robin Dunn
robin at alldunn.com
Mon Sep 4 17:33:07 PDT 2006
Peter Damoc wrote:
> Hi Robin,
>
> Unfortunately the error appears in 20060902 too.
> I've tried to isolate it in a small sample.
> The attached code depends on PIL
> To reproduce the error try dragging one of the images from the left
> thumbnail browser to one of the placeholders on the right.
> If you drag it fast enough the error would not appear BUT if you drag it
> slow enough or if you try to drag it over the lower gray part... it
> should throw the exceptions. It might be something wrong in my code
> but... it works in 2.6 :)
Your DropTarget has a code path that doesn't return a drag result:
def OnDragOver(self, x, y, ref):
try:
r = wx.Rect(3,3,165,148)
if r.InsideXY(x, y):
i = ((y-3)/76)*3+(x-3)/55
# print x, y, i
if self.parent.highlight != i:
self.parent.highlight = i
self.parent.Refresh()
return wx.DragCopy
else:
if self.parent.highlight != None:
self.parent.highlight = None
self.parent.Refresh()
return wx.DragNone # <== Add this line
except:
import traceback
traceback.print_exc()
return wx.DragError
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-dev
mailing list