diff options
author | Walter Bender <walter.bender@gmail.com> | 2012-05-09 19:53:46 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2012-05-09 19:53:46 (GMT) |
commit | 436565ef58fa463cbd9fb87955c3eee8e6e5d400 (patch) | |
tree | 1082d94298772897c7b81978f2fd47b568d06d6d | |
parent | 708e5377e2d14aa0558563bcc7620e7955989b0e (diff) |
restore challenge on clean
-rw-r--r-- | TurtleArt/tabasics.py | 10 | ||||
-rw-r--r-- | TurtleArt/tawindow.py | 1 | ||||
-rw-r--r-- | TurtleConfusionActivity.py | 1 |
3 files changed, 10 insertions, 2 deletions
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 ''' |