Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-07-02 15:41:08 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-07-02 15:41:08 (GMT)
commit609dfa7b066a67c8c6cd542b4735a1e8ebb42131 (patch)
tree588c0efa945e6a69809e172a3fd930f57f6f50ed
parent7f1f1c9febbd9225bd24feb2ed22957731068c69 (diff)
make sandwich a macro
-rw-r--r--TurtleArt/taconstants.py4
-rw-r--r--plugins/turtle_blocks_extras/turtle_blocks_extras.py9
2 files changed, 13 insertions, 0 deletions
diff --git a/TurtleArt/taconstants.py b/TurtleArt/taconstants.py
index d1d9858..0285f7b 100644
--- a/TurtleArt/taconstants.py
+++ b/TurtleArt/taconstants.py
@@ -218,6 +218,10 @@ VOICES = {'af': 'afrikaans', 'cy': 'welsh-test', 'el': 'greek',
# Macros (groups of blocks)
#
MACROS = {
+ 'clamp':
+ [[0, 'sandwichtop_no_label', 0, 0, [None, 1]],
+ [1, 'vspace', 0, 0, [0, 2]],
+ [2, 'sandwichbottom', 0, 0, [1, None]]],
'kbinput':
[[0, 'until', 0, 0, [None, 1, 4, None]],
[1, 'greater2', 0, 0, [0, 2, 3, None]],
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
index 9617d12..ade0508 100644
--- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py
+++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
@@ -671,7 +671,15 @@ module found in the Journal'))
label=_('turtle shell'),
help_string=_("put a custom 'shell' on the turtle"))
+ # macro
+ palette.add_block('clamp',
+ style='collapsible-top-no-label',
+ label=[' ', ' '],
+ special_name=_('top'),
+ help_string=_('top of a collapsed stack'))
+
palette.add_block('sandwichtop_no_label',
+ hidden=True,
style='collapsible-top-no-label',
label=[' ', ' '],
special_name=_('top'),
@@ -679,6 +687,7 @@ module found in the Journal'))
help_string=_('top of a collapsed stack'))
palette.add_block('sandwichbottom',
+ hidden=True,
style='collapsible-bottom',
label=[' ', ' '],
prim_name='nop',