Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2010-02-03 16:03:22 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2010-02-03 16:03:22 (GMT)
commitd306fb21464579a3a7d727812f060ce02c54a19a (patch)
treef1099ce7d2e7b76d9361ca43256bf9ba8b3391b4
parent2573df3606380970efb3a106bff10dba0437b6be (diff)
added showblock
-rw-r--r--constants.py10
-rw-r--r--talogo.py1
-rw-r--r--tawindow.py9
3 files changed, 17 insertions, 3 deletions
diff --git a/constants.py b/constants.py
index a949706..74975f6 100644
--- a/constants.py
+++ b/constants.py
@@ -52,8 +52,9 @@ PALETTES = [['forward', 'back', 'clean', 'left', 'right', 'show',
['kbinput', 'push', 'printheap', 'keyboard', 'pop', 'clearheap',
'myfunc', 'nop', 'leftpos', 'toppos', 'width', 'rightpos',
'bottompos', 'height', 'turtle', 'print'],
- ['journal', 'audio', 'description', 'hideblocks', 'template1x1',
- 'template1x2', 'template2x1', 'template2x2', 'list'],
+ ['journal', 'audio', 'description', 'list', 'template1x1',
+ 'template1x2', 'template2x1', 'template2x2',
+ 'hideblocks', 'showblocks'],
['restore']]
#
@@ -95,7 +96,7 @@ BASIC_STYLE_HEAD = ['start', 'hat1', 'hat2', 'restore']
BASIC_STYLE_HEAD_1ARG = ['hat']
BASIC_STYLE_TAIL = ['stopstack']
BASIC_STYLE = ['clean', 'penup', 'pendown', 'stack1', 'stack2', 'vspace',
- 'hideblocks', 'clearheap', 'printheap', 'kbinput']
+ 'hideblocks', 'showblocks', 'clearheap', 'printheap', 'kbinput']
BASIC_STYLE_1ARG = ['forward', 'back', 'left', 'right', 'seth', 'show',
'setscale', 'setpensize', 'setcolor', 'setshade', 'print',
'settextsize', 'settextcolor', 'print', 'wait', 'storeinbox1',
@@ -232,6 +233,7 @@ BLOCK_NAMES = {
'setxy':[_('set xy'),_('x'),_('y')],
'shade':[_('shade')],
'show':[_('show')],
+ 'showblocks':[_('show blocks')],
'sqrt':['√'],
'stack':[_('action')],
'stack1':[_('action 1')],
@@ -329,6 +331,7 @@ PRIMITIVES = {
'setxy':'setxy',
'shade':'shade',
'show':'show',
+ 'showblocks':'showblocks',
'sqrt':'sqrt',
'stack':'stack',
'stack1':'stack1',
@@ -553,6 +556,7 @@ HELP_STRINGS = {
'setxy':_("move turtle to position xcor, ycor; (0, 0) is in the center of the screen."),
'shade':_("holds current pen shade (can be used in place of a number block)"),
'show':_("draw text or show media from the Journal"),
+ 'showblocks':_("restores hidden blocks"),
'sqrt':_("calculate square root"),
'stack1':_("invoke action 1 stack"),
'stack2':_("invoke action 2 stack"),
diff --git a/talogo.py b/talogo.py
index 70cc21b..252be09 100644
--- a/talogo.py
+++ b/talogo.py
@@ -251,6 +251,7 @@ class LogoCode:
'setxy':[2, lambda self, x, y: self.tw.canvas.setxy(x, y)],
'shade':[0, lambda self: self.tw.canvas.shade],
'show':[1,lambda self, x: self.show(x, True)],
+ 'showblocks':[0, lambda self: self.tw.showblocks()],
'sound':[1, lambda self,x: self.play_sound(x)],
'sqrt':[1, lambda self,x: sqrt(x)],
'stack1':[0, self.prim_stack1, True],
diff --git a/tawindow.py b/tawindow.py
index 4a7f72d..3fdfa64 100644
--- a/tawindow.py
+++ b/tawindow.py
@@ -261,6 +261,15 @@ class TurtleArtWindow():
self.activity.do_hide()
"""
+ Callback from 'show blocks' block
+ """
+ def showblocks(self):
+ self.hide = True
+ self.hideshow_button()
+ if self.running_sugar:
+ self.activity.do_show()
+
+ """
Where is the mouse event?
"""
def xy(self, event):