From fc4b6a64cc06bb35328835a382c14a8af542d20c Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Mon, 21 Mar 2011 19:53:04 +0000 Subject: FLAG DAY: passing TurtleWindow instead of LogoCode instance as 1st argument --- (limited to 'pysamples/push_mouse_event.py') diff --git a/pysamples/push_mouse_event.py b/pysamples/push_mouse_event.py index 6966310..26301ac 100644 --- a/pysamples/push_mouse_event.py +++ b/pysamples/push_mouse_event.py @@ -23,7 +23,7 @@ # palette is selected. -def myblock(lc, x): # ignore second argument +def myblock(tw, x): # ignore second argument ########################################################################### # @@ -31,11 +31,11 @@ def myblock(lc, x): # ignore second argument # ########################################################################### - if lc.tw.mouse_flag == 1: + if tw.mouse_flag == 1: # push y first so x will be popped first - lc.heap.append((lc.tw.canvas.height / 2) - lc.tw.mouse_y) - lc.heap.append(lc.tw.mouse_x - (lc.tw.canvas.width / 2)) - lc.heap.append(1) # mouse event - lc.tw.mouse_flag = 0 + tw.lc.heap.append((tw.canvas.height / 2) - tw.mouse_y) + tw.lc.heap.append(tw.mouse_x - (tw.canvas.width / 2)) + tw.lc.heap.append(1) # mouse event + tw.mouse_flag = 0 else: - lc.heap.append(0) # no mouse event + tw.lc.heap.append(0) # no mouse event -- cgit v0.9.1