From ce577910b12d5819c32957918dfb145a8b63e45e Mon Sep 17 00:00:00 2001 From: Pootle daemon Date: Fri, 17 May 2013 04:31:05 +0000 Subject: Merge branch 'master' of git.sugarlabs.org:turtleart/mainline --- 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) -- cgit v0.9.1