Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/talogo.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2010-01-28 00:25:46 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2010-01-28 00:25:46 (GMT)
commitf579eedc9e7cdf2b6d176c66bb53c4034d23290f (patch)
tree3772dd3cdb3a9d030ed191c640bf09c544bd43cd /talogo.py
parenta91b6c55f4185be1265a9dee43c14d2bbcffff64 (diff)
cleaning up
Diffstat (limited to 'talogo.py')
-rw-r--r--talogo.py29
1 files changed, 12 insertions, 17 deletions
diff --git a/talogo.py b/talogo.py
index ae661c6..ea637af 100644
--- a/talogo.py
+++ b/talogo.py
@@ -615,23 +615,18 @@ def lcNew(tw):
return lc
def display_coordinates(tw, a=-1, b=-1, d=-1):
- if hasattr(tw, "activity"):
- if hasattr(tw.activity, "coordinates_label"):
- if a==-1 and b==-1 and d == -1:
- x = round_int(tw.canvas.xcor/tw.coord_scale)
- y = round_int(tw.canvas.ycor/tw.coord_scale)
- h = round_int(tw.canvas.heading)
- else:
- x = a
- y = b
- h = d
- tw.activity.coordinates_label.set_text(_("xcor") + " = " + \
- str(x) + " " + \
- _("ycor") + " = " + \
- str(y) + " " + \
- _("heading") + " = " + \
- str(h))
- tw.activity.coordinates_label.show()
+ if a==-1 and b==-1 and d == -1:
+ x = round_int(tw.canvas.xcor/tw.coord_scale)
+ y = round_int(tw.canvas.ycor/tw.coord_scale)
+ h = round_int(tw.canvas.heading)
+ else:
+ x = a
+ y = b
+ h = d
+ if tw.running_sugar():
+ tw.activity.coordinates_label.set_text("%s: %d %s: %d %s: %d" % (
+ _("xcor"), x, _("ycor"), y, _("heading"), h))
+ tw.activity.coordinates_label.show()
def round_int(n):
if int(float(n)) == n: