Skip to content

Commit

Permalink
fixed raphael examples, which were causing run time errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bearney74 committed Jun 23, 2012
1 parent d460c68 commit 2651eb8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 1 addition & 3 deletions examples/raphael/graffle.py
Expand Up @@ -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__":
Expand All @@ -72,4 +71,3 @@ def up(obj):
graffle.draw()
graffle.connect()
pyjd.run()

11 changes: 7 additions & 4 deletions library/pyjamas/raphael/raphael.py
Expand Up @@ -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)

#############################################################################

Expand Down

0 comments on commit 2651eb8

Please sign in to comment.