From 436565ef58fa463cbd9fb87955c3eee8e6e5d400 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Wed, 09 May 2012 19:53:46 +0000 Subject: restore challenge on clean --- diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py index cf309cd..1704224 100644 --- a/TurtleArt/tabasics.py +++ b/TurtleArt/tabasics.py @@ -137,7 +137,7 @@ class Palettes(): lambda self, x: primitive_dictionary['move']( self.tw.canvas.forward, -x)) - primitive_dictionary['clean'] = self.tw.lc.prim_clear + primitive_dictionary['clean'] = self._prim_clean palette.add_block('clean', style='basic-style-extended-vertical', label=_('clean'), @@ -852,6 +852,7 @@ buttons')) palette.add_block('storeinbox1', style='basic-style-1arg', label=_('store in box 1'), + string_or_number=True, prim_name='storeinbox1', default=100, logo_command='make "box1', @@ -863,6 +864,7 @@ buttons')) palette.add_block('storeinbox2', style='basic-style-1arg', label=_('store in box 2'), + string_or_number=True, prim_name='storeinbox2', default=100, logo_command='make "box2', @@ -1005,6 +1007,12 @@ variable')) # Block primitives + def _prim_clean(self): + ''' Clean block ''' + self.tw.lc.prim_clear + self.tw.display_coordinates() + self.tw.parent.restore_challenge() + def _prim_and(self, x, y): """ Logical and """ return x & y diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index d2b408d..44e95a6 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -494,6 +494,7 @@ class TurtleArtWindow(): self.lc.find_value_blocks() # Are there blocks to update? self.lc.prim_clear() self.display_coordinates() + self.parent.restore_challenge() def run_button(self, time, running_from_button_push=False): """ Run turtle! """ diff --git a/TurtleConfusionActivity.py b/TurtleConfusionActivity.py index 2f28b84..0bb3af7 100644 --- a/TurtleConfusionActivity.py +++ b/TurtleConfusionActivity.py @@ -340,7 +340,6 @@ class TurtleConfusionActivity(activity.Activity): self.recenter() self.tw.eraser_button() gobject.timeout_add(250, self.eraser_button.set_icon, 'eraseron') - self.restore_challenge() def restore_challenge(self): ''' Restore the current challange after a clear screen ''' -- cgit v0.9.1