<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi,<div><br></div><div>This activity was written by Julius B. Lucks, Adrian DelMaestro, Sera L. Young</div><div>in early 2007.</div><div>Some time ago I found it and check if it was on ASLO. I'm not found and</div><div>decide create a GIT repo [1] and make the changes for new sugar versions.</div><div>I only change the basic things such as olpcgames -> sugargames library.</div><div>Your patch was pushed.</div><div><br></div><div><div>> Here's a hack patch to make this work. I think the more normal approach</div><div>> is to write the app more like a state machine, with only one place that</div><div>> handles and swallows pygame events, leading to just one place where this</div><div>> event could be neatly handled.</div><div><br></div><div>Patchs are welcome :-)</div><div><br></div><div>Regards!</div><div><br></div><div>Alan</div><div><br></div><div>[1] <a href="http://git.sugarlabs.org/kukuanakula" target="_blank" style="font-size: 12pt;">http://git.sugarlabs.org/kukuanakula</a></div><br><div>> From: dsd@laptop.org<br>> To: alanjas@hotmail.com<br>> Date: Tue, 15 Oct 2013 14:43:30 -0400<br>> CC: sugar-devel@lists.sugarlabs.org; gruiz@fundacionzt.org<br>> Subject: [Sugar-devel] KukuAnakula: handle quit event<br>> <br>> Hi,<br>> <br>> We are looking at deploying Kuku Anakula in Nicaragua, thanks for writing<br>> this activity.<br>> <br>> One problem is that the stop button doesn't actually cause the process<br>> to terminate. Notably, the music keeps playing and never stops, even though<br>> the activity has disappeared.<br>> <br>> Here's a hack patch to make this work. I think the more normal approach<br>> is to write the app more like a state machine, with only one place that<br>> handles and swallows pygame events, leading to just one place where this<br>> event could be neatly handled.<br>> <br>> --- kuku.py 2012-05-27 06:21:36.000000000 +0000<br>> +++ /home/olpc/kuku.py 2013-10-15 18:34:17.174872806 +0000<br>> @@ -595,7 +595,9 @@<br>> gtk.main_iteration()<br>> events = pygame.event.get()<br>> for evt in events:<br>> - if evt.type == pygame.KEYDOWN:<br>> + if evt.type == pygame.QUIT:<br>> + sys.exit(0)<br>> + elif evt.type == pygame.KEYDOWN:<br>> qa,num_players,score,time_clock = self.game_start(screen,gridsize,font)<br>> return (qa,num_players,score,time_clock)<br>> <br>> @@ -616,7 +618,9 @@<br>> gtk.main_iteration()<br>> events = pygame.event.get()<br>> for evt in events:<br>> - if evt.type == pygame.KEYDOWN:<br>> + if evt.type == pygame.QUIT:<br>> + sys.exit(0)<br>> + elif evt.type == pygame.KEYDOWN:<br>> qa,num_players,score,time_clock = self.game_start(screen,gridsize,font,started=1)<br>> score.set(state.score)<br>> return (qa,num_players,score,time_clock)<br>> @@ -653,7 +657,9 @@<br>> gtk.main_iteration()<br>> events = pygame.event.get()<br>> for evt in events:<br>> - if evt.type == pygame.KEYDOWN:<br>> + if evt.type == pygame.QUIT:<br>> + sys.exit(0)<br>> + elif evt.type == pygame.KEYDOWN:<br>> qa,num_players,score,time_clock = self.reset_board(screen,gridsize,font)<br>> return (qa,num_players,score,time_clock)<br>> else:<br>> @@ -824,8 +830,9 @@<br>> <br>> events = pygame.event.get()<br>> for evt in events:<br>> -<br>> - if evt.type == pygame.KEYDOWN:<br>> + if evt.type == pygame.QUIT:<br>> + sys.exit(0)<br>> + elif evt.type == pygame.KEYDOWN:<br>> # elif evt.key == pygame.K_SPACE:<br>> if not evt.key in move_keys:<br>> x = player.grid_position[0]<br>> _______________________________________________<br>> Sugar-devel mailing list<br>> Sugar-devel@lists.sugarlabs.org<br>> http://lists.sugarlabs.org/listinfo/sugar-devel<br></div></div> </div></body>
</html>