Permalink
Browse files

fixed raphael examples, which were causing run time errors

  • Loading branch information...
1 parent d460c68 commit 2651eb86ad55127fbfb7c1a6532b362819a9a79f @earney earney committed Jun 23, 2012
Showing with 8 additions and 7 deletions.
  1. +1 −3 examples/raphael/graffle.py
  2. +7 −4 library/pyjamas/raphael/raphael.py
@@ -57,12 +57,11 @@ def _move_circle(self,obj,dx,dy,x,y):
self.connection_circle.draw()
-
def start(obj,x,y):
obj.dx=0
obj.dy=0
-def up(obj):
+def up(obj, event):
pass
if __name__ == "__main__":
@@ -72,4 +71,3 @@ def up(obj):
graffle.draw()
graffle.connect()
pyjd.run()
-
@@ -647,18 +647,21 @@ def drag(self,move,start,up):
self.onMoveFunction=move
self.onStartFunction=start
self.onUpFunction=up
+
JS("""
this['_element']['drag'](@{{onMove}},@{{onStart}},@{{onUp}});
""")
- def _onMove(self,dx,dy,a,b):
+ #todo
+ #check these args and see if they are correct
+ def _onMove(self,dx,dy,x,y,event):
self.onMoveFunction(self,dx,dy,x,y)
- def _onStart(self,x,y):
+ def _onStart(self,x,y,event):
self.onStartFunction(self,x,y)
- def _onUp(self):
- self.onUpFunction(self)
+ def _onUp(self, event):
+ self.onUpFunction(self, event)
#############################################################################

0 comments on commit 2651eb8

Please sign in to comment.