Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tabasics.py
diff options
context:
space:
mode:
authorMarion <marion.zepf@gmail.com>2013-07-29 08:09:24 (GMT)
committer Marion <marion.zepf@gmail.com>2013-07-29 08:09:24 (GMT)
commit08cdd615ee47fee0df66e391e74d7eb7fb0d2e9e (patch)
tree376b55ee14609bfa913aafb2f1ebe9b9df3a4b6d /TurtleArt/tabasics.py
parentfe86642236c4ae75b98f97e54031dece1247f57c (diff)
Primitive for the 'set heading' block; fix constant arguments to Primitives
Diffstat (limited to 'TurtleArt/tabasics.py')
-rw-r--r--TurtleArt/tabasics.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py
index 7b34a37..10fa798 100644
--- a/TurtleArt/tabasics.py
+++ b/TurtleArt/tabasics.py
@@ -250,8 +250,9 @@ towards the top of the screen.)'))
self.tw.lc.def_prim(
'seth',
1,
- lambda self, x: primitive_dictionary['set'](
- 'heading', self.tw.turtles.get_active_turtle().set_heading, x))
+ Primitive(Turtle.set_heading,
+ slot_wrappers={0: Primitive(float, export_me=False)},
+ call_afterwards=lambda value: self.after_set('heading', value)))
palette.add_block('xcor',
style='box-style',
@@ -1225,6 +1226,12 @@ variable'))
if self.tw.lc.update_values:
self.tw.lc.update_label_value(name, value)
+ def after_set(self, name, value=None):
+ ''' Update the associated value blocks '''
+ if value is not None:
+ if self.tw.lc.update_values:
+ self.tw.lc.update_label_value(name, value)
+
def _prim_setbox(self, name, x, val):
''' Define value of named box '''
if x is not None: