From c62859f5c9ac7c17650d781c547f1cfb32f21517 Mon Sep 17 00:00:00 2001 From: Gary Martin Date: Tue, 25 Aug 2009 02:57:21 +0000 Subject: Over-ride olpcgames write_file so that title keeps working. --- (limited to 'activity.py') 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 -- cgit v0.9.1