Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt
diff options
context:
space:
mode:
Diffstat (limited to 'TurtleArt')
-rw-r--r--TurtleArt/taturtle.py10
-rw-r--r--TurtleArt/tawindow.py21
2 files changed, 22 insertions, 9 deletions
diff --git a/TurtleArt/taturtle.py b/TurtleArt/taturtle.py
index 12882db..64e172e 100644
--- a/TurtleArt/taturtle.py
+++ b/TurtleArt/taturtle.py
@@ -555,12 +555,16 @@ class Turtle:
int(distance)]))
self._turtles.turtle_window.send_event(event)
- def set_xy(self, pos, share=True, pendown=True):
+ def set_xy(self, pos, share=True, pendown=True, dragging=False):
old = self.get_xy()
try:
- xcor = pos[0] * self._turtles.turtle_window.coord_scale
- ycor = pos[1] * self._turtles.turtle_window.coord_scale
+ if dragging:
+ xcor = pos[0]
+ ycor = pos[1]
+ else:
+ xcor = pos[0] * self._turtles.turtle_window.coord_scale
+ ycor = pos[1] * self._turtles.turtle_window.coord_scale
except (TypeError, ValueError):
debug_output('bad value sent to %s' % (__name__),
self._turtles.turtle_window.running_sugar)
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index e20a1cf..bdaf87f 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -102,10 +102,12 @@ class TurtleArtWindow():
def __init__(self, canvas_window, path, parent=None, activity=None,
mycolors=None, mynick=None, turtle_canvas=None,
running_sugar=True, running_turtleart=True):
- '''parent -- the GTK Window that TA runs in
- activity -- the object that instantiated this TurtleArtWindow (in
- GNOME, a TurtleMain instance)
- running_turtleart -- are we running TA or exported python code?
+ '''
+ parent: the GTK Window that TA runs in
+ activity: the object that instantiated this TurtleArtWindow (in
+ GNOME, a TurtleMain instance, in Sugar, the Activity
+ instance)
+ running_turtleart: are we running TA or exported python code?
'''
self.parent = parent
self.turtle_canvas = turtle_canvas
@@ -1410,6 +1412,13 @@ class TurtleArtWindow():
if spr is not None:
blk = self.block_list.spr_to_block(spr)
if blk is not None:
+ # Make sure stop button is visible
+ if self.running_sugar:
+ self.activity.stop_turtle_button.set_icon("stopiton")
+ self.activity.stop_turtle_button.set_tooltip(
+ _('Stop turtle'))
+ elif self.interactive_mode:
+ self.toolbar_shapes['stopiton'].set_layer(TAB_LAYER)
self.showlabel('status',
label=_('Please hit the Stop Button \
before making changes to your Turtle Blocks program'))
@@ -2511,10 +2520,10 @@ before making changes to your Turtle Blocks program'))
pos = self.turtles.screen_to_turtle_coordinates((dx, dy))
if self.selected_turtle.get_pen_state():
self.selected_turtle.set_pen_state(False)
- self.selected_turtle.set_xy(pos, share=False)
+ self.selected_turtle.set_xy(pos, share=False, dragging=True)
self.selected_turtle.set_pen_state(True)
else:
- self.selected_turtle.set_xy(pos, share=False)
+ self.selected_turtle.set_xy(pos, share=False, dragging=True)
if self.update_counter % 5:
self.lc.update_label_value(
'xcor', self.selected_turtle.get_xy()[0] /