Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS7
-rw-r--r--TurtleArt/tawindow.py10
-rw-r--r--TurtleArtActivity.py2
-rw-r--r--plugins/turtle_blocks_extras/turtle_blocks_extras.py145
-rw-r--r--pysamples/load_file_to_heap.py30
-rw-r--r--pysamples/load_journal_entry_to_heap.py18
-rw-r--r--pysamples/save_heap_to_journal_entry.py39
-rw-r--r--samples/images/butia.svg108
-rw-r--r--samples/sensors-follow-path.ta93
-rw-r--r--samples/sensors-turtle-sees.ta107
-rw-r--r--samples/thumbnails/sensors-follow-path.pngbin0 -> 15267 bytes
-rwxr-xr-xturtleblocks.py4
12 files changed, 289 insertions, 274 deletions
diff --git a/NEWS b/NEWS
index 6ff2d7b..09eba1c 100644
--- a/NEWS
+++ b/NEWS
@@ -2,14 +2,21 @@
ENHANCEMENTS:
* New sample program (Snake game)
+* Refactored sensors-follow-me example
* New translations
* Moved save snapshot button to Load/Save palette (Users were confusing it
for the save image button.)
+* New blocks on extras palette: load_file_to_heap and save_heap_to_file
+* Added confirmation alert to empty trash block
+* Dismiss samples store by clicking on canvas
+* Reordered layout of extras palette to better commodate new blocks
BUG FIXES:
* Fixed regression in Sugar 84 support
* Fixed problem with GNOME due to Sugar button check (Alan Aguiar)
* Fixed label updates on mouse x, mouse y, and keyboard
+* Fixed bug with see block
+* Fixed bug in sharing filled shapes
191
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index 5612595..5072ab2 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -1340,7 +1340,7 @@ class TurtleArtWindow():
for g in find_group(blk):
g.spr.move_relative((int(dx), int(dy)))
g.spr.save_xy = g.spr.get_xy()
- if self.running_sugar: # and not self.hw in [XO1]:
+ if self.running_sugar and not self.hw in [XO1]:
g.spr.move_relative((self.activity.hadj_value,
self.activity.vadj_value))
y += int(h + 3)
@@ -1378,7 +1378,7 @@ class TurtleArtWindow():
for g in find_group(blk):
g.spr.move_relative((dx, dy))
g.spr.save_xy = g.spr.get_xy()
- if self.running_sugar: # and not self.hw in [XO1]:
+ if self.running_sugar and not self.hw in [XO1]:
g.spr.move_relative((self.activity.hadj_value,
self.activity.vadj_value))
x += int(w + 4)
@@ -1432,7 +1432,7 @@ class TurtleArtWindow():
if show:
self.palette_button[2].save_xy = \
self.palette_button[2].get_xy()
- if self.running_sugar: # and not self.hw in [XO1]:
+ if self.running_sugar and not self.hw in [XO1]:
self.palette_button[2].move_relative(
(self.activity.hadj_value, self.activity.vadj_value))
self.palette_sprs[n][self.orientation].set_layer(
@@ -1450,7 +1450,7 @@ class TurtleArtWindow():
Sprite(self.sprite_list, x, y, svg_str_to_pixbuf(
svg.palette(w, h)))
self.palette_sprs[n][self.orientation].save_xy = (x, y)
- if self.running_sugar: # and not self.hw in [XO1]:
+ if self.running_sugar and not self.hw in [XO1]:
self.palette_sprs[n][self.orientation].move_relative(
(self.activity.hadj_value, self.activity.vadj_value))
if self.orientation == 0 and w > self.width:
@@ -1481,6 +1481,8 @@ class TurtleArtWindow():
if self.running_sugar:
self._show_unfullscreen_button()
+ self.activity.hide_store()
+
# Find out what was clicked
spr = self.sprite_list.find_sprite((x, y))
diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py
index 8b4b5a0..23cecce 100644
--- a/TurtleArtActivity.py
+++ b/TurtleArtActivity.py
@@ -1647,7 +1647,7 @@ in order to use the plugin.'))
''' Anything that needs restoring after a clear screen can go here '''
pass
- def _hide_store(self, widget=None):
+ def hide_store(self, widget=None):
if self._sample_window is not None:
self._sample_box.hide()
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
index 2f17c53..e31cb27 100644
--- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py
+++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
@@ -397,6 +397,7 @@ to the stack'))
palette.add_block('see',
style='box-style',
label=_('turtle sees'),
+ value_block=True,
prim_name='see',
help_string=_('returns the color that the turtle \
"sees"'))
@@ -488,17 +489,6 @@ make "tmp first :taheap\nmake "taheap butfirst :taheap\noutput :tmp\nend\n')
self.tw.lc.def_prim('isheapempty', 0,
lambda self: primitive_dictionary['isheapempty']())
- primitive_dictionary['isheapempty2'] = self._prim_is_heap_empty_bool
- palette.add_block('isheapempty2',
- style='boolean-block-style',
- label=_('empty heap?'),
- prim_name='isheapempty2',
- value_block=True,
- help_string=_('returns True if heap is empty'))
- self.tw.lc.def_prim('isheapempty2', 0,
- lambda self:
- primitive_dictionary['isheapempty2']())
-
primitive_dictionary['saveheap'] = self._prim_save_heap
palette.add_block('saveheap',
style='basic-style-1arg',
@@ -521,6 +511,17 @@ last-out heap) from a file'))
self.tw.lc.def_prim('loadheap', 1,
lambda self, x: primitive_dictionary['loadheap'](x))
+ primitive_dictionary['isheapempty2'] = self._prim_is_heap_empty_bool
+ palette.add_block('isheapempty2',
+ style='boolean-block-style',
+ label=_('empty heap?'),
+ prim_name='isheapempty2',
+ value_block=True,
+ help_string=_('returns True if heap is empty'))
+ self.tw.lc.def_prim('isheapempty2', 0,
+ lambda self:
+ primitive_dictionary['isheapempty2']())
+
primitive_dictionary['print'] = self._prim_print
palette.add_block('comment',
style='basic-style-1arg',
@@ -563,6 +564,14 @@ bottom of the screen'))
self.tw.lc.def_prim('int', 1,
lambda self, x: primitive_dictionary['int'](x))
+ palette.add_block('polar',
+ style='basic-style-extended-vertical',
+ label=_('polar'),
+ prim_name='polar',
+ help_string=_('displays polar coordinates'))
+ self.tw.lc.def_prim('polar', 0,
+ lambda self: self.tw.set_polar(True))
+
primitive_dictionary['myfunction'] = self._prim_myfunction
palette.add_block('myfunc1arg',
style='number-style-var-arg',
@@ -604,6 +613,14 @@ advanced multi-variable math equations, e.g., sin(x+y+z)'))
lambda self, f, x, y, z:
primitive_dictionary['myfunction'](f, [x, y, z]))
+ palette.add_block('cartesian',
+ style='basic-style-extended-vertical',
+ label=_('Cartesian'),
+ prim_name='cartesian',
+ help_string=_('displays Cartesian coordinates'))
+ self.tw.lc.def_prim('cartesian', 0,
+ lambda self: self.tw.set_cartesian(True))
+
primitive_dictionary['userdefined'] = self._prim_myblock
palette.add_block('userdefined',
style='basic-style-var-arg',
@@ -657,21 +674,52 @@ module found in the Journal'))
MEDIA_SHAPES.append('pythonoff')
MEDIA_SHAPES.append('pythonon')
- palette.add_block('cartesian',
- style='basic-style-extended-vertical',
- label=_('Cartesian'),
- prim_name='cartesian',
- help_string=_('displays Cartesian coordinates'))
- self.tw.lc.def_prim('cartesian', 0,
- lambda self: self.tw.set_cartesian(True))
+ primitive_dictionary['loadblock'] = self._prim_load_block
+ palette.add_block('loadblock',
+ style='basic-style-var-arg',
+ label=_('load'),
+ prim_name='loadblock',
+ default=_('forward'),
+ help_string=_('loads a block'))
+ self.tw.lc.def_prim('loadblock', 1,
+ lambda self, x:
+ primitive_dictionary['loadblock'](x))
- palette.add_block('polar',
- style='basic-style-extended-vertical',
- label=_('polar'),
- prim_name='polar',
- help_string=_('displays polar coordinates'))
- self.tw.lc.def_prim('polar', 0,
- lambda self: self.tw.set_polar(True))
+ palette.add_block('loadblock2arg',
+ style='basic-style-var-arg',
+ hidden=True,
+ label=_('load'),
+ prim_name='loadblock2',
+ string_or_number=True,
+ default=[_('forward'), 100],
+ help_string=_('loads a block'))
+ self.tw.lc.def_prim('loadblock2', 2,
+ lambda self, x, y:
+ primitive_dictionary['loadblock']([x, y]))
+
+ palette.add_block('loadblock3arg',
+ style='basic-style-var-arg',
+ hidden=True,
+ label=_('load'),
+ string_or_number=True,
+ prim_name='loadblock3',
+ default=[_('setxy'), 0, 0],
+ help_string=_('loads a block'))
+ self.tw.lc.def_prim('loadblock3', 3,
+ lambda self, x, y, z:
+ primitive_dictionary['loadblock']([x, y, z]))
+
+ primitive_dictionary['loadpalette'] = self._prim_load_palette
+ palette.add_block('loadpalette',
+ style='basic-style-1arg',
+ string_or_number=True,
+ label=_('select palette'),
+ prim_name='loadpalette',
+ default=_('turtle'),
+ help_string=_('selects a palette'))
+ self.tw.lc.def_prim('loadpalette', 1,
+ lambda self, x:
+ primitive_dictionary['loadpalette'](x))
palette.add_block('addturtle',
style='basic-style-1arg',
@@ -752,53 +800,6 @@ module found in the Journal'))
special_name=_('top'),
help_string=_('top of a collapsed stack'))
- primitive_dictionary['loadblock'] = self._prim_load_block
- palette.add_block('loadblock',
- style='basic-style-var-arg',
- label=_('load'),
- prim_name='loadblock',
- default=_('forward'),
- help_string=_('loads a block'))
- self.tw.lc.def_prim('loadblock', 1,
- lambda self, x:
- primitive_dictionary['loadblock'](x))
-
- palette.add_block('loadblock2arg',
- style='basic-style-var-arg',
- hidden=True,
- label=_('load'),
- prim_name='loadblock2',
- string_or_number=True,
- default=[_('forward'), 100],
- help_string=_('loads a block'))
- self.tw.lc.def_prim('loadblock2', 2,
- lambda self, x, y:
- primitive_dictionary['loadblock']([x, y]))
-
- palette.add_block('loadblock3arg',
- style='basic-style-var-arg',
- hidden=True,
- label=_('load'),
- string_or_number=True,
- prim_name='loadblock3',
- default=[_('setxy'), 0, 0],
- help_string=_('loads a block'))
- self.tw.lc.def_prim('loadblock3', 3,
- lambda self, x, y, z:
- primitive_dictionary['loadblock']([x, y, z]))
-
- primitive_dictionary['loadpalette'] = self._prim_load_palette
- palette.add_block('loadpalette',
- style='basic-style-1arg',
- string_or_number=True,
- label=_('select palette'),
- prim_name='loadpalette',
- default=_('turtle'),
- help_string=_('selects a palette'))
- self.tw.lc.def_prim('loadpalette', 1,
- lambda self, x:
- primitive_dictionary['loadpalette'](x))
-
def _portfolio_palette(self):
debug_output('creating %s palette' % _('portfolio'),
self.tw.running_sugar)
diff --git a/pysamples/load_file_to_heap.py b/pysamples/load_file_to_heap.py
deleted file mode 100644
index 919d6b5..0000000
--- a/pysamples/load_file_to_heap.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#Copyright (c) 2010-11, Walter Bender, Tony Forster
-
-# This procedure is invoked when the user-definable block on the
-# "extras" palette is selected.
-
-# Usage: Import this code into a Python (user-definable) block; when
-# this code is run, the chooser will be opened for selecting a file
-# from the GNU/Linux file system. The contents of that file will be
-# loaded onto the FILO heap. Data is assumed to be json encoded.
-
-
-def myblock(tw, path):
- ''' Load heap from file (GNOME only) '''
-
- import os
- from TurtleArt.tautils import get_load_name, data_from_file
-
- if type(path) == float:
- path = ''
-
- if not os.path.exists(path):
- path, tw.load_save_folder = get_load_name('.*', tw.load_save_folder)
- if path is None:
- return
-
- data = data_from_file(path)
- if data is not None:
- for val in data:
- tw.lc.heap.append(val)
- tw.lc.update_label_value('pop', tw.lc.heap[-1])
diff --git a/pysamples/load_journal_entry_to_heap.py b/pysamples/load_journal_entry_to_heap.py
deleted file mode 100644
index 3dd3bb5..0000000
--- a/pysamples/load_journal_entry_to_heap.py
+++ /dev/null
@@ -1,18 +0,0 @@
-#Copyright (c) 2010-11, Walter Bender, Tony Forster
-
-# This procedure is invoked when the user-definable block on the
-# "extras" palette is selected.
-
-# Usage: Import this code into a Python (user-definable) block; when
-# this code is run, the chooser will be opened for selecting a file
-# from the Journal. The contents of that file will be loaded onto the
-# FILO heap.
-
-
-def myblock(tw, x): # ignore second argument
- ''' Load heap from journal (Sugar only) '''
-
- from TurtleArt.tautils import chooser
-
- # Choose a datastore object and push data to heap (Sugar only)
- chooser(tw.parent, '', tw.lc.push_file_data_to_heap)
diff --git a/pysamples/save_heap_to_journal_entry.py b/pysamples/save_heap_to_journal_entry.py
deleted file mode 100644
index a06d4d0..0000000
--- a/pysamples/save_heap_to_journal_entry.py
+++ /dev/null
@@ -1,39 +0,0 @@
-#Copyright (c) 2010-11, Walter Bender, Tony Forster
-
-# This procedure is invoked when the user-definable block on the
-# "extras" palette is selected.
-
-# Usage: Import this code into a Python (user-definable) block; when
-# this code is run, the contents of the FILO heap are saved to a
-# Journal entry named by the value of the argument to the Python
-# block.
-
-
-def myblock(tw, title):
- ''' Save heap to journal (Sugar only) '''
-
- import os.path
- from gettext import gettext as _
-
- from sugar.activity import activity
- from sugar.datastore import datastore
- from sugar import profile
-
- from TurtleArt.tautils import get_path, data_to_file
-
- # Save JSON-encoded heap to temporary file
- heap_file = os.path.join(get_path(activity, 'instance'),
- str(title) + '.txt')
- data_to_file(tw.lc.heap, heap_file)
-
- # Create a datastore object
- dsobject = datastore.create()
-
- # Write any metadata (specifically set the title of the file
- # and specify that this is a plain text file).
- dsobject.metadata['title'] = str(title)
- dsobject.metadata['icon-color'] = profile.get_color().to_string()
- dsobject.metadata['mime_type'] = 'text/plain'
- dsobject.set_file_path(heap_file)
- datastore.write(dsobject)
- dsobject.destroy()
diff --git a/samples/images/butia.svg b/samples/images/butia.svg
new file mode 100644
index 0000000..3edae1c
--- /dev/null
+++ b/samples/images/butia.svg
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="333.71198"
+ height="333.71167"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="butia.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1"
+ inkscape:cx="139.05958"
+ inkscape:cy="161.83778"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1366"
+ inkscape:window-height="709"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Capa 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-224.14403,-286.92437)">
+ <path
+ sodipodi:type="arc"
+ style="fill:none;stroke:#63c521;stroke-width:46.87316513;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path3066"
+ sodipodi:cx="442.85715"
+ sodipodi:cy="480.93362"
+ sodipodi:rx="140"
+ sodipodi:ry="145.71428"
+ d="m 582.85715,480.93362 c 0,80.47578 -62.68014,145.71428 -140,145.71428 -77.31987,0 -140,-65.2385 -140,-145.71428 0,-80.47577 62.68013,-145.71427 140,-145.71427 77.31986,0 140,65.2385 140,145.71427 z"
+ transform="matrix(0.91413861,0,0,0.87829005,-13.832809,31.380984)" />
+ <path
+ style="fill:none;stroke:#63c521;stroke-width:40;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 336.94341,400.00662 108.1132,107.54717"
+ id="path3838"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#63c521;stroke-width:40;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="M 445.05661,400.00662 336.94341,507.55379"
+ id="path3838-6"
+ inkscape:connector-curvature="0" />
+ <g
+ id="g3968"
+ transform="translate(-2.4511719e-6,0.08248621)">
+ <path
+ sodipodi:nodetypes="czc"
+ inkscape:connector-curvature="0"
+ id="path3860-7"
+ d="m 233.14403,366.55256 c 0,0 14.74049,-22.8697 31.35874,-39.35193 16.61827,-16.48222 39.35194,-31.35875 39.35194,-31.35875"
+ style="fill:none;stroke:#63c521;stroke-width:18;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:20;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="czc"
+ inkscape:connector-curvature="0"
+ id="path3860-7-9"
+ d="m 548.85599,366.55256 c 0,0 -14.74049,-22.8697 -31.35874,-39.35193 -16.61827,-16.48222 -39.35194,-31.35875 -39.35194,-31.35875"
+ style="fill:none;stroke:#63c521;stroke-width:18;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:20;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="czc"
+ inkscape:connector-curvature="0"
+ id="path3860-7-6"
+ d="m 233.14403,540.84287 c 0,0 14.74049,22.8697 31.35874,39.35193 16.61827,16.48222 39.35194,31.35875 39.35194,31.35875"
+ style="fill:none;stroke:#63c521;stroke-width:18;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:20;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="czc"
+ inkscape:connector-curvature="0"
+ id="path3860-7-9-8"
+ d="m 548.85599,540.84287 c 0,0 -14.74049,22.8697 -31.35874,39.35193 -16.61827,16.48222 -39.35194,31.35875 -39.35194,31.35875"
+ style="fill:none;stroke:#63c521;stroke-width:18;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:20;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ </g>
+</svg>
diff --git a/samples/sensors-follow-path.ta b/samples/sensors-follow-path.ta
new file mode 100644
index 0000000..7af6d50
--- /dev/null
+++ b/samples/sensors-follow-path.ta
@@ -0,0 +1,93 @@
+[[0, ["start", 2.0], 20, 180, [null, 60]],
+[1, "setcolor", 778, 712, [52, 21, 53]],
+[2, "setcolor", 778, 544, [27, 22, 51]],
+[3, "hat", 1060, 120, [null, 4, 88]],
+[4, ["string", "path"], 1119, 132, [3, null]],
+[5, "stack", 778, 796, [53, 6, null]],
+[6, ["string", "path"], 837, 796, [5, null]],
+[7, ["forever", 231], 20, 352, [9, 90, null]],
+[8, ["vspace", 0], 38, 470, [10, 18]],
+[9, "penup", 20, 310, [70, 7]],
+[10, "forward", 38, 428, [90, 11, 8]],
+[11, ["number", 10.0], 112, 428, [10, null]],
+[12, "left", 56, 830, [29, 13, null]],
+[13, ["number", 30], 135, 830, [12, null]],
+[14, "right", 56, 620, [31, 15, null]],
+[15, ["number", 30], 128, 620, [14, null]],
+[16, "see", 160, 478, [20, null]],
+[17, "see", 160, 688, [24, null]],
+[18, ["if", 21], 38, 512, [8, 20, 31, 19]],
+[19, ["vspace", 0], 38, 680, [18, 23]],
+[20, ["equal2", 0], 104, 478, [18, 16, 65, null]],
+[21, "blue", 859, 712, [1, null]],
+[22, "red", 859, 544, [2, null]],
+[23, ["if", 21], 38, 722, [19, 24, 29, null]],
+[24, ["equal2", 0], 104, 688, [23, 17, 25, null]],
+[25, "red", 160, 730, [24, null]],
+[26, "clean", 778, 208, [69, 66]],
+[27, "setpensize", 778, 502, [55, 28, 2]],
+[28, ["number", 25], 879, 502, [27, null]],
+[29, "back", 56, 788, [23, 30, 12]],
+[30, ["number", 10.0], 114, 788, [29, null]],
+[31, "back", 56, 578, [18, 32, 14]],
+[32, ["number", 10.0], 114, 578, [31, null]],
+[33, "forward", 1078, 616, [35, 34, 37]],
+[34, ["number", 10], 1152, 616, [33, null]],
+[35, ["repeat", 21], 1060, 574, [39, 36, 33, null]],
+[36, ["number", 10], 1120, 574, [35, null]],
+[37, "right", 1078, 658, [33, 38, null]],
+[38, ["number", 9], 1150, 658, [37, null]],
+[39, "hat", 1060, 520, [null, 40, 35]],
+[40, ["string", "right"], 1119, 532, [39, null]],
+[41, "hat", 1060, 300, [null, 42, 43]],
+[42, ["string", "left"], 1119, 312, [41, null]],
+[43, ["repeat", 21], 1060, 354, [41, 44, 45, null]],
+[44, ["number", 10], 1120, 354, [43, null]],
+[45, "forward", 1078, 396, [43, 46, 47]],
+[46, ["number", 10], 1152, 396, [45, null]],
+[47, "left", 1078, 438, [45, 48, null]],
+[48, ["number", 9], 1157, 438, [47, null]],
+[49, "stack", 778, 628, [51, 50, 52]],
+[50, ["string", "path"], 837, 628, [49, null]],
+[51, "startfill", 778, 586, [2, 49]],
+[52, "stopfill", 778, 670, [49, 1]],
+[53, "setpensize", 778, 754, [1, 54, 5]],
+[54, ["number", 50], 879, 754, [53, null]],
+[55, ["fillscreen", 0], 778, 418, [67, 57, 56, 27]],
+[56, ["number", 50], 908, 460, [55, null]],
+[57, "yellow", 908, 418, [55, null]],
+[58, "hat", 760, 120, [null, 59, 69]],
+[59, ["string", "draw path"], 819, 132, [58, null]],
+[60, "stack", 20, 226, [0, 61, 70]],
+[61, ["string", "draw path"], 79, 226, [60, null]],
+[62, ["setxy2", 0], 778, 292, [66, 63, 64, 67]],
+[63, ["number", -100], 839, 292, [62, null]],
+[64, ["number", -100], 839, 334, [62, null]],
+[65, "yellow", 160, 520, [20, null]],
+[66, "penup", 778, 250, [26, 62]],
+[67, "pendown", 778, 376, [62, 55]],
+[68, "sandwichclampcollapsed", 1078, 216, [88, 78, null]],
+[69, "sandwichclampcollapsed", 760, 174, [58, 26, null]],
+[70, "skin", 20, 268, [60, 71, 9]],
+[71, ["journal", "/home/walter/Activities/TurtleBlocks.activity/samples/images/butia.svg"], 109, 268, [70, null]],
+[72, "stack", 1096, 292, [78, 73, 74]],
+[73, ["string", "left"], 1155, 292, [72, null]],
+[74, "stack", 1096, 334, [72, 75, 86]],
+[75, ["string", "right"], 1155, 334, [74, null]],
+[76, "stack", 1096, 418, [86, 77, 80]],
+[77, ["string", "right"], 1155, 418, [76, null]],
+[78, "forward", 1096, 250, [68, 79, 72]],
+[79, ["number", 25.0], 1170, 250, [78, null]],
+[80, "forward", 1096, 460, [76, 81, 82]],
+[81, ["number", 25.0], 1170, 460, [80, null]],
+[82, "stack", 1096, 502, [80, 83, 84]],
+[83, ["string", "right"], 1155, 502, [82, null]],
+[84, "stack", 1096, 544, [82, 85, null]],
+[85, ["string", "left"], 1155, 544, [84, null]],
+[86, "forward", 1096, 376, [74, 87, 76]],
+[87, ["number", 25.0], 1170, 376, [86, null]],
+[88, ["repeat", 0], 1060, 174, [3, 89, 68, null]],
+[89, ["number", 4], 1120, 174, [88, null]],
+[90, "wait", 38, 386, [7, 91, 10]],
+[91, ["number", 0.1], 107, 386, [90, null]],
+[-1, ["turtle", "Yertle"], -66.3397459621555, -178.30127018922207, 240.0, 70, 50, 50.0]] \ No newline at end of file
diff --git a/samples/sensors-turtle-sees.ta b/samples/sensors-turtle-sees.ta
deleted file mode 100644
index ac90671..0000000
--- a/samples/sensors-turtle-sees.ta
+++ /dev/null
@@ -1,107 +0,0 @@
-[[0, ["start", 2.0], 186, 203, [null, 99]],
-[1, "setcolor", 548, 701, [91, 21, 92]],
-[2, "setcolor", 548, 549, [30, 22, 90]],
-[3, "hat", 1280, 79, [null, 4, 36]],
-[4, ["string", "path"], 1338, 87, [3, null]],
-[5, "stack", 548, 785, [92, 6, null]],
-[6, ["string", "path"], 606, 785, [5, null]],
-[7, "forever", 186, 321, [9, 10, null]],
-[8, ["vspace", 0], 247, 381, [10, 18]],
-[9, "penup", 186, 287, [99, 7]],
-[10, "forward", 247, 339, [7, 11, 8]],
-[11, ["number", 5], 318, 339, [10, null]],
-[12, "left", 299, 741, [32, 13, null]],
-[13, ["number", 30], 357, 741, [12, null]],
-[14, "right", 299, 533, [34, 15, null]],
-[15, ["number", 30], 357, 533, [14, null]],
-[16, "see", 331, 389, [20, null]],
-[17, "see", 331, 597, [25, null]],
-[18, "if", 247, 423, [8, 20, 34, 19]],
-[19, ["vspace", 40.0], 247, 509, [18, 23]],
-[20, ["equal2", 0], 285, 389, [18, 16, 104, null]],
-[21, "blue", 625, 701, [1, null]],
-[22, "red", 625, 549, [2, null]],
-[23, "if", 247, 631, [19, 25, 32, 24]],
-[24, ["vspace", 20.0], 247, 717, [23, 28]],
-[25, ["equal2", 0], 285, 597, [23, 17, 26, null]],
-[26, "red", 331, 639, [25, null]],
-[27, "clean", 548, 237, [97, 105]],
-[28, "wait", 247, 799, [24, 29, null]],
-[29, ["number", 0.1], 305, 799, [28, null]],
-[30, "setpensize", 548, 507, [94, 31, 2]],
-[31, ["number", 25], 650, 507, [30, null]],
-[32, "back", 299, 699, [23, 33, 12]],
-[33, ["number", 5], 357, 699, [32, null]],
-[34, "back", 299, 491, [18, 35, 14]],
-[35, ["number", 5], 357, 491, [34, null]],
-[36, "forward", 1280, 129, [3, 37, 66]],
-[37, ["number", 100], 1351, 129, [36, null]],
-[38, "forward", 1280, 213, [66, 39, 68]],
-[39, ["number", 100], 1351, 213, [38, null]],
-[40, "forward", 1280, 339, [64, 41, 72]],
-[41, ["number", 250], 1351, 339, [40, null]],
-[42, "forward", 1280, 465, [62, 43, 76]],
-[43, ["number", 100], 1351, 465, [42, null]],
-[44, "forward", 1280, 549, [76, 45, 74]],
-[45, ["number", 150], 1351, 549, [44, null]],
-[46, "forward", 1121, 797, [48, 47, 50]],
-[47, ["number", 10], 1192, 797, [46, null]],
-[48, "repeat", 1056, 737, [52, 49, 46, null]],
-[49, ["number", 10], 1107, 737, [48, null]],
-[50, "right", 1121, 839, [46, 51, null]],
-[51, ["number", 9], 1179, 839, [50, null]],
-[52, "hat", 1056, 687, [null, 53, 48]],
-[53, ["string", "right"], 1114, 695, [52, null]],
-[54, "hat", 825, 678, [null, 55, 56]],
-[55, ["string", "left"], 883, 686, [54, null]],
-[56, "repeat", 825, 728, [54, 57, 58, null]],
-[57, ["number", 10], 876, 728, [56, null]],
-[58, "forward", 890, 788, [56, 59, 60]],
-[59, ["number", 10], 961, 788, [58, null]],
-[60, "left", 890, 830, [58, 61, null]],
-[61, ["number", 9], 948, 830, [60, null]],
-[62, "stack", 1280, 423, [72, 63, 42]],
-[63, ["string", "left"], 1338, 423, [62, null]],
-[64, "stack", 1280, 297, [68, 65, 40]],
-[65, ["string", "right"], 1338, 297, [64, null]],
-[66, "stack", 1280, 171, [36, 67, 38]],
-[67, ["string", "left"], 1338, 171, [66, null]],
-[68, "stack", 1280, 255, [38, 69, 64]],
-[69, ["string", "right"], 1338, 255, [68, null]],
-[70, "stack", 1280, 633, [74, 71, 78]],
-[71, ["string", "right"], 1338, 633, [70, null]],
-[72, "stack", 1280, 381, [40, 73, 62]],
-[73, ["string", "right"], 1338, 381, [72, null]],
-[74, "stack", 1280, 591, [44, 75, 70]],
-[75, ["string", "right"], 1338, 591, [74, null]],
-[76, "stack", 1280, 507, [42, 77, 44]],
-[77, ["string", "right"], 1338, 507, [76, null]],
-[78, "stack", 1280, 675, [70, 79, 80]],
-[79, ["string", "left"], 1338, 675, [78, null]],
-[80, "stack", 1280, 717, [78, 81, 82]],
-[81, ["string", "left"], 1338, 717, [80, null]],
-[82, "stack", 1280, 759, [80, 83, 86]],
-[83, ["string", "right"], 1338, 759, [82, null]],
-[84, "stack", 548, 625, [90, 85, 91]],
-[85, ["string", "path"], 606, 625, [84, null]],
-[86, "stack", 1280, 801, [82, 87, 88]],
-[87, ["string", "right"], 1338, 801, [86, null]],
-[88, "forward", 1280, 843, [86, 89, null]],
-[89, ["number", 50], 1351, 843, [88, null]],
-[90, "startfill", 548, 591, [2, 84]],
-[91, "stopfill", 548, 667, [84, 1]],
-[92, "setpensize", 548, 743, [1, 93, 5]],
-[93, ["number", 50], 650, 743, [92, null]],
-[94, ["fillscreen", 0], 548, 423, [106, 96, 95, 30]],
-[95, ["number", 50], 630, 465, [94, null]],
-[96, "yellow", 630, 423, [94, null]],
-[97, "hat", 548, 187, [null, 98, 27]],
-[98, ["string", "draw maze"], 606, 195, [97, null]],
-[99, "stack", 186, 245, [0, 100, 9]],
-[100, ["string", "draw maze"], 244, 245, [99, null]],
-[101, ["setxy2", 0], 548, 305, [105, 102, 103, 106]],
-[102, ["number", -100], 606, 305, [101, null]],
-[103, ["number", -100], 606, 347, [101, null]],
-[104, "yellow", 331, 431, [20, null]],
-[105, "penup", 548, 271, [27, 101]],
-[106, "pendown", 548, 389, [101, 94]]] \ No newline at end of file
diff --git a/samples/thumbnails/sensors-follow-path.png b/samples/thumbnails/sensors-follow-path.png
new file mode 100644
index 0000000..a4916a9
--- /dev/null
+++ b/samples/thumbnails/sensors-follow-path.png
Binary files differ
diff --git a/turtleblocks.py b/turtleblocks.py
index d982307..94c0fb7 100755
--- a/turtleblocks.py
+++ b/turtleblocks.py
@@ -397,8 +397,6 @@ return %s(self)" % (p, P, P)
MenuBuilder.make_menu_item(menu, _('New'), self._do_new_cb)
MenuBuilder.make_menu_item(menu, _('Show sample projects'),
self._create_store)
- MenuBuilder.make_menu_item(menu, _('Hide sample projects'),
- self._hide_store)
MenuBuilder.make_menu_item(menu, _('Open'), self._do_open_cb)
MenuBuilder.make_menu_item(menu, _('Load project'), self._do_load_cb)
MenuBuilder.make_menu_item(menu, _('Save'), self._do_save_cb)
@@ -787,7 +785,7 @@ Would you like to save before quitting?'))
''' Anything that needs restoring after a clear screen can go here '''
pass
- def _hide_store(self, widget=None):
+ def hide_store(self, widget=None):
if self._sample_window is not None:
self._sample_box.hide()