Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tawindow.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2010-01-29 14:08:09 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2010-01-29 14:08:09 (GMT)
commite322350dcd6b7c7ffa8e665f0587b87148310b38 (patch)
treea380702e8eee6bc26d51b449235f152544c33abb /tawindow.py
parent9cb44a3809d307bbbddd66fc08006f7bf9713b68 (diff)
fixed label docking problem
Diffstat (limited to 'tawindow.py')
-rw-r--r--tawindow.py44
1 files changed, 22 insertions, 22 deletions
diff --git a/tawindow.py b/tawindow.py
index b556054..eefd3f5 100644
--- a/tawindow.py
+++ b/tawindow.py
@@ -1039,27 +1039,27 @@ class TurtleArtWindow():
newspr.set_layer(TOP_LAYER)
self.drag_pos = 20, 20
newblk.connections = [None]*len(newblk.docks)
- print DEFAULTS[newblk.name]
- for i, argvalue in enumerate(DEFAULTS[newblk.name]):
- # skip the first dock position--it is always a connector
- dock = newblk.docks[i+1]
- argname = dock[0]
- if argname == 'unavailable':
- continue
- if (type(argvalue) is str or type(argvalue) is unicode) and\
- argname == 'number':
- argname = 'string'
- (sx, sy) = newspr.get_xy()
- argblk = Block(self.block_list, self.sprite_list,
- argname, 0, 0, 'block', [argvalue])
- argdock = argblk.docks[0]
- nx, ny = sx+dock[2]-argdock[2], sy+dock[3]-argdock[3]
- argblk.spr.move((nx, ny))
- argblk.spr.set_layer(TOP_LAYER)
- argblk.connections = [newblk, None]
- newblk.connections[i+1] = argblk
- self.drag_group = self._find_group(newblk)
- self.block_operation = 'new'
+ if DEFAULTS.has_key(newblk.name):
+ for i, argvalue in enumerate(DEFAULTS[newblk.name]):
+ # skip the first dock position--it is always a connector
+ dock = newblk.docks[i+1]
+ argname = dock[0]
+ if argname == 'unavailable':
+ continue
+ if (type(argvalue) is str or type(argvalue) is unicode) and\
+ argname == 'number':
+ argname = 'string'
+ (sx, sy) = newspr.get_xy()
+ argblk = Block(self.block_list, self.sprite_list,
+ argname, 0, 0, 'block', [argvalue])
+ argdock = argblk.docks[0]
+ nx, ny = sx+dock[2]-argdock[2], sy+dock[3]-argdock[3]
+ argblk.spr.move((nx, ny))
+ argblk.spr.set_layer(TOP_LAYER)
+ argblk.connections = [newblk, None]
+ newblk.connections[i+1] = argblk
+ self.drag_group = self._find_group(newblk)
+ self.block_operation = 'new'
"""
Debugging tools
@@ -1140,7 +1140,7 @@ class TurtleArtWindow():
if block1.name in ('write', 'plus', 'equal', 'less', 'greater',
'template1', 'template2', 'template3',
'template4', 'template6', 'template7', 'nop',
- 'print', 'stack'):
+ 'print', 'stack', 'hat'):
if block1.name == 'write' and d1type == 'string':
if d2type == 'number' or d2type == 'string':
pass