Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary Martin <gary@garycmartin.com>2009-08-25 02:57:21 (GMT)
committer Gary Martin <gary@garycmartin.com>2009-08-25 02:57:21 (GMT)
commitc62859f5c9ac7c17650d781c547f1cfb32f21517 (patch)
tree297cdff2e9daf14195bb41c8a0f82bc62239a750
parentb845cc3471e99bb1121bd918f57908235db6bd07 (diff)
Over-ride olpcgames write_file so that title keeps working.
-rw-r--r--activity.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/activity.py b/activity.py
index b7f0d33..2256d2c 100644
--- a/activity.py
+++ b/activity.py
@@ -16,6 +16,18 @@ class PhysicsActivity(olpcgames.PyGameActivity):
super(PhysicsActivity, self).__init__(handle)
self.metadata['mime_type'] = 'application/x-physics-activity'
+ def write_file(self, file_path):
+ """Over-ride olpcgames write_file so that title keeps working.
+ """
+ event = olpcgames.eventwrap.Event(
+ type = pygame.USEREVENT,
+ code = olpcgames.FILE_WRITE_REQUEST,
+ filename = file_path,
+ metadata = self.metadata)
+ olpcgames.eventwrap.post(event)
+ event.block()
+ event.retire() # <- without this, title editing stops updating
+
# setup the toolbar
def build_toolbar(self):
# make a toolbox