wxLine works sometimes and sometimes not

Hi! Here Im again with my draws hehe. Now its all working fine but sometimes when I have 3 or more draws and I delete one in the middle, I want that a new line is maked to link the draws. But its strange because sometimes it works fine and sometimes not. Above have the error that list for me when the line isnt maked.

Traceback (most recent call last):
  File "test.py", line 83, in EventoKey
    self.Delete()
  File "test.py", line 113, in Delete
     fromShape.AddLine(line, toShape)
  File "/usr/local/lib/python2.2/site-packages/wxPython/oglbasic.py", line 499, in AddLine
     var = apply(oglbasicc.wxPyShape_AddLine,(self,) + _args, _kwargs)
TypeError: Typer error in argument 3 of wxPyShape_AddLine. Expected _wxPyShape_p.

Diego

test.py (3.89 KB)

Diego Galho Prestes wrote:

Hi! Here Im again with my draws hehe. Now its all working fine but sometimes when I have 3 or more draws and I delete one in the middle, I want that a new line is maked to link the draws. But its strange because sometimes it works fine and sometimes not. Above have the error that list for me when the line isnt maked.

Traceback (most recent call last):
File "test.py", line 83, in EventoKey
   self.Delete()
File "test.py", line 113, in Delete
    fromShape.AddLine(line, toShape)
File "/usr/local/lib/python2.2/site-packages/wxPython/oglbasic.py", line 499, in AddLine
    var = apply(oglbasicc.wxPyShape_AddLine,(self,) + _args, _kwargs)
TypeError: Typer error in argument 3 of wxPyShape_AddLine. Expected _wxPyShape_p.

If you add a print statement you'll see that toShape's C++ object has been deleted:

"wxPython wrapper for DELETED wxPyRectangleShape object! (The C++ object no longer exists.)"

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!