[gcompris] music activities, removed clearResponsePic()
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcompris] music activities, removed clearResponsePic()
- Date: Mon, 10 Sep 2012 20:44:39 +0000 (UTC)
commit 9e2b4d14d82c2b8b9ff6783c4bbe1f130fe63ad1
Author: Bruno Coudoin <bruno coudoin free fr>
Date: Mon Sep 10 22:13:59 2012 +0200
music activities, removed clearResponsePic()
This function was in gcomprimusic but used only for the easter
eggs.
src/piano_composition-activity/gcomprismusic.py | 11 +++-----
.../piano_composition.py | 25 ++++++++++++--------
2 files changed, 19 insertions(+), 17 deletions(-)
---
diff --git a/src/piano_composition-activity/gcomprismusic.py b/src/piano_composition-activity/gcomprismusic.py
index 8054439..f987280 100644
--- a/src/piano_composition-activity/gcomprismusic.py
+++ b/src/piano_composition-activity/gcomprismusic.py
@@ -1269,7 +1269,7 @@ def textButton(x, y, text, self, color='gray', width=100000, includeText=False):
textButton(350, 400, 'Nei Ho', self, color='red')
textButton(500, 400, 'Zdravstvuyte', self, color='teal', width=70)
'''
- self.textbox = goocanvas.Text(
+ textbox = goocanvas.Text(
parent=self.rootitem,
x=x, y=y,
width=width,
@@ -1279,7 +1279,7 @@ def textButton(x, y, text, self, color='gray', width=100000, includeText=False):
pointer_events="GOO_CANVAS_EVENTS_NONE"
)
TG = 15
- bounds = self.textbox.get_bounds()
+ bounds = textbox.get_bounds()
img = goocanvas.Image(
parent=self.rootitem,
@@ -1291,9 +1291,9 @@ def textButton(x, y, text, self, color='gray', width=100000, includeText=False):
)
gcompris.utils.item_focus_init(img, None)
- self.textbox.raise_(img)
+ textbox.raise_(img)
if includeText:
- return img, self.textbox
+ return img, textbox
else:
return img
@@ -1347,9 +1347,6 @@ def textBox(text, x, y , rootitem, width=10000,
return text, rect
return text
-def clearResponsePic(self):
- self.responsePic.remove()
-
def pianokeyBindings(keyval, self):
'''
nice key bindings for the piano keys
diff --git a/src/piano_composition-activity/piano_composition.py b/src/piano_composition-activity/piano_composition.py
index 78e3ef3..6361cc2 100644
--- a/src/piano_composition-activity/piano_composition.py
+++ b/src/piano_composition-activity/piano_composition.py
@@ -148,7 +148,7 @@ class Gcompris_piano_composition:
self.changeClefButton = textButton(100, 140, _("Erase and Change Clef"), self, 'gray', 100)
if (level >= 3):
- self.textbox = goocanvas.Text(
+ goocanvas.Text(
parent=self.rootitem,
x=210, y=140,
width=100,
@@ -664,37 +664,41 @@ dialogue to\nenable the sound."), stop_board)
r += str(x.numID) + str(x.noteType)
if not self._bachEasterEggDone and '-5617' in s:
- self.responsePic = goocanvas.Image(
+ responsePic = goocanvas.Image(
parent=self.rootitem,
pixbuf=gcompris.utils.load_pixmap('piano_composition/bach.jpg'),
x=250,
y=50
)
- self.timers.append(gobject.timeout_add(2000, clearResponsePic, self))
+ self.timers.append(gobject.timeout_add(2000,
+ lambda: responsePic.remove() ) )
self._bachEasterEggDone = True
if not self._mozartEasterEggDone and '523248685848383244284428' in r:
- self.responsePic = goocanvas.Image(
+ responsePic = goocanvas.Image(
parent=self.rootitem,
pixbuf=gcompris.utils.load_pixmap('piano_composition/mozart.jpg'),
x=160,
y=80
)
- self.timers.append(gobject.timeout_add(2000, clearResponsePic, self))
+ self.timers.append(gobject.timeout_add(2000,
+ lambda: responsePic.remove() ) )
self._mozartEasterEggDone = True
if not self._bananaEasterEggGone and '7464-4464-4464' in r:
- self.responsePic = goocanvas.Image(
+ responsePic = goocanvas.Image(
parent=self.rootitem,
pixbuf=gcompris.utils.load_pixmap('piano_composition/banana.png'),
x=200,
y=10
)
- self.responsePic.animate(5, 5, 3.0, 0.0, \
+ responsePic.animate(5, 5, 3.0, 0.0, \
absolute=False, duration=800, step_time=100, type=goocanvas.ANIMATE_FREEZE)
- self.timers.append(gobject.timeout_add(800, clearResponsePic, self))
+ self.timers.append(gobject.timeout_add(800,
+ lambda: responsePic.remove() ) )
+
self._bananaEasterEggGone = True
if not self._gsoc2012EasterEggGone and '14181814343838345458585481' in r:
- self.responsePic = goocanvas.Image(
+ responsePic = goocanvas.Image(
parent=self.rootitem,
pixbuf=gcompris.utils.load_pixmap('piano_composition/gsoc2012.jpg'),
x= -20,
@@ -703,7 +707,8 @@ dialogue to\nenable the sound."), stop_board)
self.responsePic.animate(0, 400, 1, 0, \
absolute=False, duration=1000, step_time=100, type=goocanvas.ANIMATE_FREEZE)
- self.timers.append(gobject.timeout_add(1000, clearResponsePic, self))
+ self.timers.append(gobject.timeout_add(1000,
+ lambda: responsePic.remove() ) )
self._gsoc2012EasterEggGone = True
def end(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]