Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPootle daemon <pootle@pootle.sugarlabs.org>2013-05-17 04:31:05 (GMT)
committer Pootle daemon <pootle@pootle.sugarlabs.org>2013-05-17 04:31:05 (GMT)
commitce577910b12d5819c32957918dfb145a8b63e45e (patch)
tree0462371c230d7aae7ca4c06eea3d8affdb3bb9b9
parent2046dad862db39c2b9f96317b382d7a3b38d6bcb (diff)
parent372547cbb63fd2416ee434be1cfaacc051c35344 (diff)
Merge branch 'master' of git.sugarlabs.org:turtleart/mainline
-rw-r--r--plugins/turtle_blocks_extras/turtle_blocks_extras.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
index 6201fae..6b0f3ce 100644
--- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py
+++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
@@ -696,6 +696,17 @@ module found in the Journal'))
self.tw.lc.def_prim('turtle', 1,
lambda self, x: self.tw.canvas.set_turtle(x))
+ primitive_dictionary['activeturtle'] = self._prim_active_turtle
+ palette.add_block('activeturtle',
+ style='box-style',
+ #TRANS: pop removes a new item from the program stack
+ label=_('active turtle'),
+ prim_name='activeturtle',
+ value_block=True,
+ help_string=_('the name of the active turtle'))
+ self.tw.lc.def_prim('activeturtle', 0,
+ lambda self: primitive_dictionary['activeturtle']())
+
primitive_dictionary['skin'] = self._prim_reskin
palette.add_block('skin',
hidden=True,
@@ -1231,6 +1242,9 @@ _('Palette of user-defined operators'))
self.tw.lc.heap.append(g)
self.tw.lc.heap.append(r)
+ def _prim_active_turtle(self):
+ return(self.tw.active_turtle.name)
+
def _prim_reskin(self, media):
""" Reskin the turtle with an image from a file """
scale = int(ICON_SIZE * float(self.tw.lc.scale) / DEFAULT_SCALE)