[gcompris/gcomprixogoo] Added the manual in the first start of ballcatch.



commit 27c6ebab8f14a2ec16a3f20fcc2b32232827535e
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Tue Jan 19 22:25:44 2010 +0100

    Added the manual in the first start of ballcatch.

 src/ballcatch-activity/ballcatch.py |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/ballcatch-activity/ballcatch.py b/src/ballcatch-activity/ballcatch.py
index 660d693..74538c2 100644
--- a/src/ballcatch-activity/ballcatch.py
+++ b/src/ballcatch-activity/ballcatch.py
@@ -26,6 +26,7 @@ import gcompris.bonus
 import gcompris.sound
 import gtk
 import gtk.gdk
+import pango
 from gcompris import gcompris_gettext as _
 
 # ----------------------------------------
@@ -65,6 +66,20 @@ class Gcompris_ballcatch:
     # only have to kill it. The canvas deletes all the items it contains automaticaly.
     self.rootitem = goocanvas.Group(parent =  self.gcomprisBoard.canvas.get_root_item())
 
+    # The instructions
+    self.instruction = goocanvas.Text(
+      parent = self.rootitem,
+      x = 600.0,
+      y = 300.0,
+      width = 250,
+      text = _("Press the two shift keys at the same time,"
+               " to make the ball go in a straight line."),
+      fill_color = "black",
+      anchor = gtk.ANCHOR_CENTER,
+      alignment = pango.ALIGN_CENTER
+      )
+
+
     # Tux
     goocanvas.Image(
       parent = self.rootitem,
@@ -152,6 +167,9 @@ class Gcompris_ballcatch:
     if (keyval == gtk.keysyms.Shift_R):
       self.right_continue = False
 
+    if (not self.left_continue and not self.right_continue):
+      self.instruction.props.visibility = goocanvas.ITEM_INVISIBLE
+
     return False
 
   # Called by gcompris core



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]