Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-05-12 12:33:07 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-05-12 12:33:07 (GMT)
commita01b019f06771ba88db68d01fab32774049603ed (patch)
treeda56392ee72e51802366e099e8a5a66416ddccd4 /TurtleArt
parent10d1cbeb364a3ac07a7a1c56bc2b6963627c7f10 (diff)
blank coordinate view when running with rabbit (#3599)
Diffstat (limited to 'TurtleArt')
-rw-r--r--TurtleArt/talogo.py7
-rw-r--r--TurtleArt/tawindow.py37
2 files changed, 33 insertions, 11 deletions
diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py
index 1e5bf07..422d4f9 100644
--- a/TurtleArt/talogo.py
+++ b/TurtleArt/talogo.py
@@ -415,6 +415,7 @@ class LogoCode:
if self.bindex is not None:
self.tw.block_list.list[self.bindex].highlight()
self.tw.showblocks()
+ self.tw.display_coordinates()
raise logoerror(str(self.iresult))
self.iline = oldiline
self.ireturn()
@@ -454,6 +455,7 @@ class LogoCode:
if token.nargs == None:
self.tw.showblocks()
+ self.tw.display_coordinates()
raise logoerror("#noinput")
for i in range(token.nargs):
self._no_args_check()
@@ -510,6 +512,7 @@ class LogoCode:
return False
except logoerror, e:
self.tw.showblocks()
+ self.tw.display_coordinates()
self.tw.showlabel('syntaxerror', str(e))
self.tw.turtles.show_all()
return False
@@ -540,6 +543,7 @@ class LogoCode:
if self.iline and self.iline[0] is not self.symnothing:
return
self.tw.showblocks()
+ self.tw.display_coordinates()
raise logoerror("#noinput")
#
@@ -755,6 +759,9 @@ class LogoCode:
# manage the connections and flows locally means we may run
# into trouble if any of these block types (forever, while,
# until. ifelse, stopstack, or stack) is changed in tablock.py
+
+ # TODO: Detect nesting, e.g., forever while
+
if b.name == 'while':
while_blk = True
else:
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index d2b408d..2d4c38e 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -1334,15 +1334,20 @@ class TurtleArtWindow():
if spr.name == 'run-fastoff':
self.lc.trace = 0
self.hideblocks()
+ self.display_coordinates(clear=True)
self.run_button(0)
elif spr.name == 'run-slowoff':
self.lc.trace = 1
+ self.showblocks()
self.run_button(3)
elif spr.name == 'debugoff':
self.lc.trace = 1
+ self.showblocks()
self.run_button(6)
elif spr.name == 'stopiton':
self.stop_button()
+ self.display_coordinates()
+ self.showblocks()
self.toolbar_shapes['stopiton'].hide()
elif spr.name == 'eraseron':
self.eraser_button()
@@ -3168,18 +3173,28 @@ class TurtleArtWindow():
self.canvas.shade, self.canvas.pensize))
return _data
- def display_coordinates(self):
+ def display_coordinates(self, clear=False):
""" Display the coordinates of the current turtle on the toolbar """
- x = round_int(float(self.canvas.xcor) / self.coord_scale)
- y = round_int(float(self.canvas.ycor) / self.coord_scale)
- h = round_int(self.canvas.heading)
- if self.running_sugar:
- self.activity.coordinates_label.set_text("%s: %d %s: %d %s: %d" %\
- (_("xcor"), x, _("ycor"), y, _("heading"), h))
- self.activity.coordinates_label.show()
- elif self.interactive_mode:
- self.parent.set_title("%s — %s: %d %s: %d %s: %d" % \
- (_("Turtle Art"), _("xcor"), x, _("ycor"), y, _("heading"), h))
+ if clear:
+ if self.running_sugar:
+ self.activity.coordinates_label.set_text('')
+ self.activity.coordinates_label.show()
+ elif self.interactive_mode:
+ self.parent.set_title('')
+ else:
+ x = round_int(float(self.canvas.xcor) / self.coord_scale)
+ y = round_int(float(self.canvas.ycor) / self.coord_scale)
+ h = round_int(self.canvas.heading)
+ if self.running_sugar:
+ self.activity.coordinates_label.set_text(
+ "%s: %d %s: %d %s: %d" % (_("xcor"), x, _("ycor"), y,
+ _("heading"), h))
+ self.activity.coordinates_label.show()
+ elif self.interactive_mode:
+ self.parent.set_title(
+ "%s — %s: %d %s: %d %s: %d" % (
+ _("Turtle Art"), _("xcor"), x, _("ycor"), y,
+ _("heading"), h))
def showlabel(self, shp, label=''):
""" Display a message on a status block """