Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/07/2009, 14:07
iozk
 
Fecha de Ingreso: mayo-2008
Mensajes: 499
Antigüedad: 16 años
Puntos: 1
ayuda con variables

hola tengo un error que me dice que no esta definido la variable

Código:
Traceback (most recent call last):
  File "C:\Users\oscars\Documents\NetBeansProjects\PythonProjectIDE\src\Ribbon.py", line 862, in OnMouseMotion
    nPos = (self.wdPos.x + (dPos.x - self.ldPos.x),self.wdPos.y + (dPos.y - self.ldPos.y))
AttributeError: 'Ribbon' object has no attribute 'wdPos'
no se porque pasa si esta bien definida o ¿no?
Código python:
Ver original
  1. def OnMouseLeftDown(self, event):
  2.         self.Refresh()
  3.         self.wdPos = self.ClientToScreen((0, 0))
  4.         self.ldPos = event.GetEventObject().ClientToScreen(event.GetPosition())
  5.        
  6.         self.CaptureMouse()
  7.  
  8.     def OnMouseMotion(self, event):
  9.         if event.Dragging() and event.LeftIsDown():
  10.             dPos = event.GetEventObject().ClientToScreen(event.GetPosition())
  11.             nPos = (self.wdPos.x + (dPos.x - self.ldPos.x),self.wdPos.y + (dPos.y - self.ldPos.y))
  12.             self.Move(nPos)
  13.  
  14.  
  15.     def OnMouseLeftUp(self, event):
  16.         self.ReleaseMouse()