From ac66903e36f30bf501fbdc1e28d4c660f8ef60a8 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sat, 07 May 2011 13:25:36 +0000 Subject: added clear all button to trash palette --- (limited to 'TurtleArt') diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py index 8a43dbd..0f01830 100644 --- a/TurtleArt/tabasics.py +++ b/TurtleArt/tabasics.py @@ -947,6 +947,11 @@ variable')) label=_('restore all'), help_string=_('restore all blocks from trash')) + palette.add_block('trashall', + style='basic-style-tail', + label=_('clear all'), + help_string=_('move all blocks to trash')) + # Block primitives def _prim_and(self, x, y): diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index 38565e2..5aff270 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -935,6 +935,10 @@ class TurtleArtWindow(): self._restore_latest_from_trash() elif blk.name == 'empty': self._empty_trash() + elif blk.name == 'trashall': + for b in self.just_blocks(): + if b.type != 'trash': + self._put_in_trash(find_top_block(b)) elif blk.name in MACROS: self._new_macro(blk.name, x + 20, y + 20) else: -- cgit v0.9.1